summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-23 15:49:06 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-23 15:49:06 +0000
commit2092db58eeedf599698a9cafd7e52a1a69fabf75 (patch)
tree217f8115528194e63b6b681ed7e2b8746ec1c241
parent302877eafc373d8ae61d7ecc66f17968d4e1e643 (diff)
downloadpx4-nuttx-2092db58eeedf599698a9cafd7e52a1a69fabf75.tar.gz
px4-nuttx-2092db58eeedf599698a9cafd7e52a1a69fabf75.tar.bz2
px4-nuttx-2092db58eeedf599698a9cafd7e52a1a69fabf75.zip
Several changes (mostly graphics related) from Petteri Aimonen
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5385 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--NxWidgets/ChangeLog.txt4
-rw-r--r--NxWidgets/libnxwidgets/src/cnumericedit.cxx8
-rw-r--r--NxWidgets/libnxwidgets/src/ctext.cxx3
-rw-r--r--nuttx/ChangeLog6
-rw-r--r--nuttx/arch/arm/src/stm32/chip/stm32_flash.h1
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_serial.c10
-rw-r--r--nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c2
-rw-r--r--nuttx/graphics/nxglib/nxglib_splitline.c7
-rw-r--r--nuttx/graphics/nxtk/nxtk_filltrapwindow.c11
9 files changed, 38 insertions, 14 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index f932d5bc2..c3ae00d6a 100644
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -211,4 +211,6 @@
using the internal work queues from user space. I have decided to implemented
user-space work queues (someday) in order to accomplish that functionaliy.
Submitted by Petteri Aimonen.
-
+* NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs
+ (from Petteri Aimonen).
+ \ No newline at end of file
diff --git a/NxWidgets/libnxwidgets/src/cnumericedit.cxx b/NxWidgets/libnxwidgets/src/cnumericedit.cxx
index e0df014c5..993e86fb8 100644
--- a/NxWidgets/libnxwidgets/src/cnumericedit.cxx
+++ b/NxWidgets/libnxwidgets/src/cnumericedit.cxx
@@ -158,9 +158,11 @@ CNumericEdit::CNumericEdit(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_
CNumericEdit::~CNumericEdit()
{
- delete m_label;
- delete m_button_minus;
- delete m_button_plus;
+ // CNxWidget destroys all children
+
+ m_label = 0;
+ m_button_minus = 0;
+ m_button_plus = 0;
}
void CNumericEdit::getPreferredDimensions(CRect &rect) const
diff --git a/NxWidgets/libnxwidgets/src/ctext.cxx b/NxWidgets/libnxwidgets/src/ctext.cxx
index 688031d88..caa0c02e8 100644
--- a/NxWidgets/libnxwidgets/src/ctext.cxx
+++ b/NxWidgets/libnxwidgets/src/ctext.cxx
@@ -276,11 +276,14 @@ const int CText::getLineTrimmedLength(const int lineNumber) const
length--;
}
while (iterator->moveToPrevious() && (length > 0));
+
+ delete iterator;
return length;
}
// May occur if data has been horribly corrupted somewhere
+ delete iterator;
return 0;
}
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 6fad0d0ba..bf7e05168 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3675,3 +3675,9 @@
file paths.
* nuttx/arch/arm/src/arm/Toolchain.defs: Add support for more ARM toolchains
(from Mike Smith).
+ * arch/arm/src/stm32/stm32f40xxx_rcc.c: Enabled FLASH prefetch (from Petteri
+ Aimonen).
+ * graphics/nxtk/nxtk_filltrapwindow.c: Correct an offset problem (from
+ Peterri Aimonen).
+ * graphics/nxglib/nxglib_splitline.c: Fix error in drawing of near horizontal
+ lines (from Peterri Aimonen).
diff --git a/nuttx/arch/arm/src/stm32/chip/stm32_flash.h b/nuttx/arch/arm/src/stm32/chip/stm32_flash.h
index c2e440923..d6fcecc11 100644
--- a/nuttx/arch/arm/src/stm32/chip/stm32_flash.h
+++ b/nuttx/arch/arm/src/stm32/chip/stm32_flash.h
@@ -110,6 +110,7 @@
# define FLASH_ACR_HLFCYA (1 << 3) /* FLASH half cycle access */
# define FLASH_ACR_PRTFBE (1 << 4) /* FLASH prefetch enable */
#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX)
+# define FLASH_ACR_PRFTEN (1 << 8) /* FLASH prefetch enable */
# define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */
# define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */
# define FLASH_ACR_ICRST (1 << 11) /* Bit 11: Instruction cache reset */
diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
index 6c1861ef8..c7f97b25a 100644
--- a/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ b/nuttx/arch/arm/src/stm32/stm32_serial.c
@@ -101,11 +101,11 @@
*/
# if (defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_RS485)) || \
- (defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_RS485)) || \
- (defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_RS485)) || \
- (defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_RS485)) || \
- (defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_RS485)) || \
- (defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_RS485)) \
+ (defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_RS485)) || \
+ (defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_RS485)) || \
+ (defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_RS485)) || \
+ (defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_RS485)) || \
+ (defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_RS485))
# error "RXDMA and RS-485 cannot be enabled at the same time for the same U[S]ART"
# endif
diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c
index 45980f288..14ee1e754 100644
--- a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c
+++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c
@@ -633,7 +633,7 @@ static void stm32_stdclockconfig(void)
/* Enable FLASH prefetch, instruction cache, data cache, and 5 wait states */
- regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN);
+ regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_PRFTEN);
putreg32(regval, STM32_FLASH_ACR);
/* Select the main PLL as system clock source */
diff --git a/nuttx/graphics/nxglib/nxglib_splitline.c b/nuttx/graphics/nxglib/nxglib_splitline.c
index 84892b67e..cbf2d5ff3 100644
--- a/nuttx/graphics/nxglib/nxglib_splitline.c
+++ b/nuttx/graphics/nxglib/nxglib_splitline.c
@@ -41,6 +41,7 @@
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
#include <nuttx/nx/nxglib.h>
@@ -192,9 +193,11 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector,
/* The final degenerate case */
- if (linewidth == 1)
+ if (linewidth == 1 &&
+ abs(line.pt2.x - line.pt1.x) < (line.pt2.y - line.pt1.y))
{
- /* A line of width 1 is basically a single parallelogram of width 1 */
+ /* A close to vertical line of width 1 is basically
+ * a single parallelogram of width 1 */
traps[1].top.x1 = itob16(line.pt1.x);
traps[1].top.x2 = traps[1].top.x1;
diff --git a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c
index c1032f1e7..55c051ffd 100644
--- a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c
+++ b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c
@@ -94,6 +94,7 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
{
FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd;
struct nxgl_rect_s relclip;
+ struct nxgl_trapezoid_s reltrap;
#ifdef CONFIG_DEBUG
if (!hfwnd || !trap || !color)
@@ -103,8 +104,14 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
}
#endif
- /* Perform the fill, clipping to the client window */
+ /* Move the trapezoid from window contents area to window area */
+ nxgl_trapoffset(&reltrap, trap,
+ fwnd->fwrect.pt1.x - fwnd->wnd.bounds.pt1.x,
+ fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y);
+
+ /* Perform the fill, clipping to the client window */
nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
- return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color);
+
+ return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, &reltrap, color);
}