mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
Fix nxgl_splitline bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3912 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
2906947c9b
commit
b4c37e50df
7 changed files with 72 additions and 37 deletions
|
@ -2020,5 +2020,7 @@
|
|||
Initially check-in is just a crude port of the STM32 SDIO driver.
|
||||
Much more is needed.
|
||||
* graphics/, include/nuttx/nx: Add new NX interfaces for drawing
|
||||
circles -- both circular outlines and filled circles.
|
||||
circles -- both circular outlines and filled circles.
|
||||
* graphic/nxglib/nxglib_spitline.c: Add a "fudge factor" that eliminates
|
||||
some problems for rendering nearly horizontal, wide lines.
|
||||
|
||||
|
|
|
@ -3591,10 +3591,14 @@ make
|
|||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top"><a href="#nxglsplitline"><code>nxgl_splitline</code></a></td>
|
||||
<td>
|
||||
Verified by <code>apps/examples/nxlines</code>.
|
||||
<td bgcolor="lightgreen">
|
||||
Verified using <code>apps/examples/nxlines</code>.
|
||||
Generally works well, but has some accuracy/overflow problems wide lines
|
||||
that are nearly horizontal.
|
||||
There is a "fudge factor" that seems to eliminate the problem,
|
||||
but there could still be issues in some configurations.
|
||||
</td>
|
||||
<td align="center" bgcolor="skyblue">YES</td>
|
||||
<td align="center" bgcolor="lightgreen">YES</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top"><a href="#nxglcirclepts"><code>nxgl_circlepts</code></a></td>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||
<p>Last Updated: August 19, 2011</p>
|
||||
<p>Last Updated: August 24, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -900,7 +900,7 @@
|
|||
<li><b>LPC17xx CAN driver</b>.
|
||||
LPC17xx CAN driver extended to support both CAN1 and CAN2 (submitted by
|
||||
Li Zhuoy (Lzzy)). A Semaphore overflow problem was also corrected in the
|
||||
CAN driver (reported by Li Zhouy (Lzzy)).
|
||||
CAN driver (reported by Li Zhouy (Lzzy)).
|
||||
</li>
|
||||
<li><b>Signal-related bugfixes</b>.
|
||||
Fixed several critical bugs related to signal handling initialization and
|
||||
|
@ -1551,12 +1551,13 @@
|
|||
<td>
|
||||
<p>
|
||||
<b>FreeScale Kinetics K40</b>.
|
||||
This port uses the Freescale Kinetis KwiStick K40.
|
||||
This port uses the Freescale Kinetis KwikStik K40.
|
||||
Refer to the <a href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KWIKSTIK-K40">Freescale web site</a> for further information about this board.
|
||||
The Kwikstik is used with the FreeScale Tower System (mostly just to provide a simple UART connection)
|
||||
</p>
|
||||
<p>
|
||||
<b>STATUS:</b>
|
||||
The unverified KwikStik K40 first appeared in NuttX-6.8
|
||||
As of this writing, the basic port is complete but I accidentally locked my board during the initial bringup.
|
||||
Further development is stalled unless I learn how to unlock the device (or until I get another K40).
|
||||
Additional work remaining includes, among other things: (1) complete the basic bring-up,
|
||||
|
@ -1583,12 +1584,12 @@
|
|||
As of this writing, the basic port is complete and passes the NuttX OS test.
|
||||
An additional, validated configuration exists for the NuttShell (NSH, see the
|
||||
<a href="http://www.nuttx.org/NuttShell.html">NSH User Guide</a>).
|
||||
And Ethernet driver also exists, but has not yet been integrated.
|
||||
Additional work remaining includes: (1) integrate the Ethernet driver,
|
||||
(3) develop support for the SDHC-based SD card, and
|
||||
(4) develop support for USB host and device.
|
||||
NOTE: Most of these remaining tasks (excluding the Ethernet driver) are the
|
||||
same as the pending K40 tasks described above.
|
||||
This basic TWR-K60N512 first appeared in NuttX-6.8.
|
||||
Ethernet and SD card (SDHC) drivers also exist:
|
||||
The SDHC driver is partially integrated in to the NSH configuration but has some outstanding issues;
|
||||
the Ethernet driver is completely untested.
|
||||
Additional work remaining includes: (1) integrate the Ethernet and SDHC drivers, and (2) develop support for USB host and device.
|
||||
NOTE: Most of these remaining tasks (excluding the Ethernet driver) are the same as the pending K40 tasks described above.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -2514,7 +2515,7 @@ Other memory:
|
|||
</table>
|
||||
|
||||
<ul><pre>
|
||||
nuttx-6.9 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
nuttx-6.8 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* arch/arm/src/lpc17xx/chip.h: Fix some chip memory configuration errors
|
||||
for the LPC1764, LPC1756, and LPC1754 (submitted by Li Zhuoy (Lzzy))
|
||||
|
@ -2530,7 +2531,7 @@ nuttx-6.9 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||
Separate configs/rgmp/x86 and configs/rgmp/arm configuration directory, and
|
||||
(2) Extract architecture dependent code in arch/rgmp/include and
|
||||
arch/rgmp/src into corresponding x86/ and arm/ directories.
|
||||
* arch/arm/src/kinetis, arch/arm/include/kinetis, configs/kwikstick-k40:
|
||||
* arch/arm/src/kinetis, arch/arm/include/kinetis, configs/kwikstik-k40:
|
||||
Add a directory structure to support the port to the Kinetis KwikStik-K40.
|
||||
There is no real substance in the initial check-in; only the directory
|
||||
structure and skeleton files (Code complete on 8/15/11).
|
||||
|
@ -2562,7 +2563,7 @@ nuttx-6.9 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||
* configs/twr-k60n512/nsh: Added and verified a NuttShell (NSH)
|
||||
configuration for the Freescale, Kinetis TWR-K60N512 board.
|
||||
|
||||
apps-6.9 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
apps-6.8 2011-08-19 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* apps/examples/nxlines: Added a test for NX line drawing capabilities.
|
||||
|
||||
|
@ -2609,8 +2610,19 @@ buildroot-1.10 2011-05-06 <spudmonkey@racsa.co.cr>
|
|||
<ul><pre>
|
||||
nuttx-6.9 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* arch/arm/src/kinetis/kinetis_sdhc.c: SDHC driver for Kinetis parts.
|
||||
Initially check-in is just a crude port of the STM32 SDIO driver.
|
||||
Much more is needed.
|
||||
* graphics/, include/nuttx/nx: Add new NX interfaces for drawing
|
||||
circles -- both circular outlines and filled circles.
|
||||
* graphic/nxglib/nxglib_spitline.c: Add a "fudge factor" that eliminates
|
||||
some problems for rendering nearly horizontal, wide lines.
|
||||
|
||||
apps-6.9 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* apps/examples/nxlines: Extend the line drawing text to include drawing
|
||||
of circles.
|
||||
|
||||
pascal-3.1 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
buildroot-1.11 2011-xx-xx <spudmonkey@racsa.co.cr>
|
||||
|
|
20
TODO
20
TODO
|
@ -1,4 +1,4 @@
|
|||
NuttX TODO List (Last updated August 22, 2011)
|
||||
NuttX TODO List (Last updated August 24, 2011)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
nuttx/
|
||||
|
@ -67,6 +67,7 @@ o Task/Scheduler (sched/)
|
|||
Description: Implement sys/wait.h and functions. Consider implementing wait,
|
||||
waitpid, waitid. At present, a parent has no information about
|
||||
child tasks.
|
||||
|
||||
Update: A simple but usable version of waitpid() has been included.
|
||||
This version is not compliant with all specifications and can be
|
||||
enabled with CONFIG_SCHED_WAITPID.
|
||||
|
@ -1348,20 +1349,3 @@ o Other Applications & Tests (apps/examples/)
|
|||
the artifact is larger.
|
||||
Status: Open
|
||||
Priority: Medium.
|
||||
|
||||
Description: examples/nxlines. There is an error in the line rendering
|
||||
on the 24th step (270 degrees). At that point, the
|
||||
calculated position is just a bit from being horizontal.
|
||||
Using configuration configs/stm3210e-eval/nxlines, I see:
|
||||
|
||||
sin: ffff0000 cos: ffffffed radius: 76 halfx: -76 halfy: -1
|
||||
|
||||
And the resulting almost horizontal line:
|
||||
|
||||
vector: (44,159)->(196,161)
|
||||
|
||||
is rendered incorrectly every time around. Looks like logic
|
||||
in nxgl_splitlines malfunctioned.
|
||||
|
||||
Status: Open
|
||||
Priority: Medium/High
|
|
@ -614,3 +614,31 @@ Where <subdir> is one of the following:
|
|||
using the DFU bootloader.
|
||||
|
||||
CONFIG_KINETIS_BUILDROOT=y : NuttX buildroot under Linux or Cygwin
|
||||
|
||||
nsh:
|
||||
---
|
||||
Configures the NuttShell (nsh) located at apps/examples/nsh. The
|
||||
Configuration enables both the serial and telnet NSH interfaces.
|
||||
Support for the board's SPI-based MicroSD card is included
|
||||
(but not passing tests as of this writing).
|
||||
|
||||
NOTE: An SDHC driver is underwork and can be enabled in the NSH
|
||||
configuration for further testing be setting the following
|
||||
configuration faluesas follows:
|
||||
|
||||
-CONFIG_KINETIS_SDHC=n
|
||||
+CONFIG_KINETIS_SDHC=y # Enable the SDHC driver
|
||||
|
||||
-CONFIG_GPIO_IRQ=n
|
||||
+CONFIG_GPIO_IRQ=y # Enable GPIO interrupts
|
||||
|
||||
-CONFIG_KINETIS_PORTEINTS=n
|
||||
+CONFIG_KINETIS_PORTEINTS=y # Enable PortE GPIO interrupts
|
||||
|
||||
-CONFIG_SCHED_WORKQUEUE=n
|
||||
+CONFIG_SCHED_WORKQUEUE=y # Enable the NuttX workqueue
|
||||
|
||||
-CONFIG_NSH_ARCHINIT=n
|
||||
+CONFIG_NSH_ARCHINIT=y # Provide NSH intialization logic
|
||||
|
||||
|
||||
|
|
|
@ -399,6 +399,7 @@ CONFIG_HAVE_LIBM=n
|
|||
CONFIG_DEBUG=n
|
||||
CONFIG_DEBUG_VERBOSE=n
|
||||
CONFIG_DEBUG_SYMBOLS=n
|
||||
CONFIG_DEBUG_FS=n
|
||||
CONFIG_MM_REGIONS=1
|
||||
CONFIG_ARCH_LOWPUTC=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
|
@ -609,6 +610,7 @@ CONFIG_FS_WRITEBUFFER=n
|
|||
# SDIO driver card detection is 100% accurate
|
||||
#
|
||||
CONFIG_SDIO_DMA=n
|
||||
CONFIG_SDIO_XFRDEBUG=n
|
||||
CONFIG_MMCSD_MMCSUPPORT=n
|
||||
CONFIG_MMCSD_HAVECARDDETECT=n
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define SMALL_SIN 1966 /* 1966/65536 = 0.03 */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -231,14 +233,14 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector,
|
|||
|
||||
/* If the sine of the angle is tiny (i.e., the line is nearly horizontal),
|
||||
* then we cannot compute the adjusted width. In this case, just use
|
||||
* the width of the line (not very good estimate -- need to revisit).
|
||||
* the width of the line bounding box.
|
||||
*/
|
||||
|
||||
sinangle = b16sin(angle);
|
||||
if (sinangle == 0)
|
||||
if (sinangle < SMALL_SIN)
|
||||
{
|
||||
adjwidth = itob16(iwidth);
|
||||
xoffset = adjwidth;
|
||||
xoffset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -246,6 +248,7 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector,
|
|||
xoffset = itob16(linewidth * linewidth);
|
||||
xoffset = b16divb16(xoffset, adjwidth);
|
||||
}
|
||||
|
||||
halfoffset = (xoffset >> 1);
|
||||
|
||||
/* Return the top triangle (if there is one). NOTE that the horizontal
|
||||
|
|
Loading…
Reference in a new issue