summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-07 21:25:24 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-07 21:25:24 +0000
commit3e7ccb82800a52be305a261df570a12a51eebeb4 (patch)
tree69130cca051fdf38817fd4c99502b30f804981e8
parent9965bdc22bf964e0b3a0036030ce34c49157c2da (diff)
Various fixes for running the NxWM unit test on the STM3240G-EVAL
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4711 7fd9a85b-ad96-42d3-883c-3090e2eb8679
-rwxr-xr-xNxWidgets/ChangeLog.txt8
-rw-r--r--NxWidgets/libnxwidgets/include/cgraphicsport.hxx15
-rw-r--r--NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx8
-rw-r--r--NxWidgets/libnxwidgets/src/cgraphicsport.cxx20
-rw-r--r--NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx37
-rw-r--r--nuttx/ChangeLog5
-rw-r--r--nuttx/Documentation/NXGraphicsSubsystem.html10
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html12
-rw-r--r--nuttx/configs/sim/nx/defconfig5
-rw-r--r--nuttx/configs/sim/nx11/defconfig5
-rw-r--r--nuttx/configs/sim/nxwm/defconfig5
-rw-r--r--nuttx/configs/stm3210e-eval/nsh2/defconfig10
-rw-r--r--nuttx/configs/stm3210e-eval/nx/defconfig10
-rw-r--r--nuttx/configs/stm3210e-eval/nxconsole/defconfig10
-rw-r--r--nuttx/configs/stm3210e-eval/nxlines/defconfig10
-rw-r--r--nuttx/configs/stm3210e-eval/nxtext/defconfig10
-rw-r--r--nuttx/configs/stm3240g-eval/nsh/defconfig10
-rw-r--r--nuttx/configs/stm3240g-eval/nxconsole/defconfig10
-rw-r--r--nuttx/configs/stm3240g-eval/nxwm/defconfig10
-rw-r--r--nuttx/graphics/README.txt8
-rw-r--r--nuttx/graphics/nxconsole/nx_register.c6
-rw-r--r--nuttx/graphics/nxconsole/nxcon_internal.h2
-rwxr-xr-xnuttx/graphics/nxconsole/nxcon_scroll.c2
-rw-r--r--nuttx/graphics/nxconsole/nxtk_register.c6
-rw-r--r--nuttx/graphics/nxconsole/nxtool_register.c6
-rw-r--r--nuttx/include/nuttx/nx/nx.h7
-rw-r--r--nuttx/include/nuttx/nx/nxconsole.h4
27 files changed, 156 insertions, 95 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index cff96bca0f..a160399a87 100755
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -28,4 +28,10 @@
* CNxWidget: Removed support for reference constants and close types.
The goal is to ge the base widget class as small as possible.
* CNxTkWindow: Fix uninitialized pointer value.
-
+* CNxToolbar: Need to "fake" the fix position callback to avoid
+ deadlock waits for the callback that won't happen.
+* CNxTkWindow: Fix toolbar background color
+* CWidgetControl: Don't declare the the geometry is good until a non-NULL
+ window size is received.
+* CGraphicsPort and CWidgetControl: If the underlying graphics device
+ is write-only, then we have to render fonts a little differently.
diff --git a/NxWidgets/libnxwidgets/include/cgraphicsport.hxx b/NxWidgets/libnxwidgets/include/cgraphicsport.hxx
index 404fb1d516..8eea3d6890 100644
--- a/NxWidgets/libnxwidgets/include/cgraphicsport.hxx
+++ b/NxWidgets/libnxwidgets/include/cgraphicsport.hxx
@@ -79,6 +79,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include "nxconfig.hxx"
#include "inxwindow.hxx"
/****************************************************************************
@@ -105,16 +106,26 @@ namespace NXWidgets
class CGraphicsPort
{
private:
- INxWindow *m_pNxWnd; /**< NX window interface. */
+ INxWindow *m_pNxWnd; /**< NX window interface. */
+#ifdef CONFIG_NX_WRITEONLY
+ nxgl_mxpixel_t m_backColor; /**< The background color to use */
+#endif
public:
/**
* Constructor.
*
- * @param pNxWnd An instance of the underlying window type.
+ * @param pNxWnd. An instance of the underlying window type.
+ * @param backColor. The background color is only needed if we
+ * cannot read from the graphics device.
*/
+#ifdef CONFIG_NX_WRITEONLY
+ CGraphicsPort(INxWindow *pNxWnd,
+ nxgl_mxpixel_t backColor = CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR);
+#else
CGraphicsPort(INxWindow *pNxWnd);
+#endif
/**
* Destructor.
diff --git a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx
index 72713f2c49..db7cb06b6d 100644
--- a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx
+++ b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx
@@ -166,6 +166,8 @@ namespace NXWidgets
TNxArray<CNxWidget*> m_widgets; /**< List of controlled
widgets. */
bool m_modal; /**< True: in modal loop */
+ bool m_haveGeometry; /**< True: indicates that we
+ have valid geometry data. */
sem_t m_modalSem; /**< Modal loops waits for
events on this semaphore */
/**
@@ -669,11 +671,7 @@ namespace NXWidgets
* CGraphicsPort instance
*/
- inline bool createGraphicsPort(INxWindow *window)
- {
- m_port = new CGraphicsPort(window);
- return m_port != (CGraphicsPort *)NULL;
- }
+ bool createGraphicsPort(INxWindow *window);
/**
* Get the CGraphicsPort instance for drawing on this window
diff --git a/NxWidgets/libnxwidgets/src/cgraphicsport.cxx b/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
index 43076e2402..d43f3bdfac 100644
--- a/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
+++ b/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
@@ -105,13 +105,23 @@ using namespace NXWidgets;
/**
* Constructor.
*
- * @param pNxWnd An instance of the underlying window type.
+ * @param pNxWnd. An instance of the underlying window type.
+ * @param backColor. The background color is only needed if we
+ * cannot read from the graphics device.
*/
+#ifdef CONFIG_NX_WRITEONLY
+CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd, nxgl_mxpixel_t backColor)
+{
+ m_pNxWnd = pNxWnd;
+ m_backColor = backColor;
+}
+#else
CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd)
{
m_pNxWnd = pNxWnd;
}
+#endif
/**
* Destructor.
@@ -673,10 +683,6 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound,
// Loop setup
-#if 0
- nxwidget_pixel_t backcolor = g_defaultWidgetStyle->colors.back;
-#endif
-
struct SBitmap bitmap;
bitmap.bpp = CONFIG_NXWIDGETS_BPP;
bitmap.fmt = CONFIG_NXWIDGETS_FMT;
@@ -736,14 +742,14 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound,
// Sometimes a solid background works, sometimes not. But reading
// from graphics memory always works.
-#if 0
+#ifdef CONFIG_NX_WRITEONLY
// Set the glyph memory to the background color
nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data;
unsigned int npixels = fontWidth * fontHeight;
for (unsigned int j = 0; j < npixels; j++)
{
- *bmPtr++ = backcolor;
+ *bmPtr++ = m_backColor;
}
#else
// Read the current contents of the destination into the glyph memory
diff --git a/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx b/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
index 9c90a5bfde..afd17e6e22 100644
--- a/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
+++ b/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
@@ -84,6 +84,7 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style)
m_port = (CGraphicsPort *)NULL;
m_modal = false;
+ m_haveGeometry = false;
m_clickedWidget = (CNxWidget *)NULL;
m_focusedWidget = (CNxWidget *)NULL;
@@ -440,14 +441,25 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow,
m_hWindow = hWindow;
nxgl_rectcopy(&m_bounds, bounds);
+ }
+
+ // In the normal start up sequence, the window is created with zero size
+ // at position 0,0. The safe thing to do is to set the position (still
+ // with size 0, then then set the size. Assuming that is what is being
+ // done, we will not report that we have valid geometry until the size
+ // becomes nonzero.
+ if (!m_haveGeometry && size->h > 0 && size->w > 0)
+ {
// Wake up any threads waiting for initial position information.
// REVISIT: If the window is moved or repositioned, then the
// position and size data will be incorrect for a period of time.
// That case should be handled here as well.
+ m_haveGeometry = true;
giveGeoSem();
}
+
sched_unlock();
}
@@ -650,6 +662,31 @@ void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl)
}
/**
+ * The creation sequence is:
+ *
+ * 1) Create a dumb CWigetControl instance
+ * 2) Pass the dumb CWidgetControl instance to the window constructor
+ * that inherits from INxWindow.
+ * 3) The call this method with the static_cast to INxWindow to,
+ * finally, create the CGraphicsPort for this window.
+ * 4) After that, the fully smartend CWidgetControl instance can
+ * be used to generate additional widgets.
+ *
+ * @param window The instance of INxWindow needed to construct the
+ * CGraphicsPort instance
+ */
+
+bool CWidgetControl::createGraphicsPort(INxWindow *window)
+{
+#ifdef CONFIG_NX_WRITEONLY
+ m_port = new CGraphicsPort(window, m_style.colors.background);
+#else
+ m_port = new CGraphicsPort(window);
+#endif
+ return m_port != (CGraphicsPort *)NULL;
+}
+
+/**
* Copy a widget style
*
* @param dest The destination style
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 6d30891af5..e6a156b1cc 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -2715,4 +2715,9 @@
* graphics/nxtk/nxtk_toolbarbounds.c: Added an interface to get the toolbar
bounding box.
* graphics/nxtk/nxtk_drawframe.c: Fix an error in drawing the window frame.
+ * NX, NxConsole: Replace CONFIG_NXCONSOLE_NOGETRUN to CONFIG_LCD_GETRUN. The
+ inability to read from the LCD is a property of the LCD, not of NxConsole.
+ Then add CONFIG_NX_WRITEONLY which is the more generic way of saying that
+ no NX component should try to read from the underlying graphic device (LCD
+ or other).
diff --git a/nuttx/Documentation/NXGraphicsSubsystem.html b/nuttx/Documentation/NXGraphicsSubsystem.html
index 857fcd1a47..2a6e88c9d2 100644
--- a/nuttx/Documentation/NXGraphicsSubsystem.html
+++ b/nuttx/Documentation/NXGraphicsSubsystem.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NX Graphics Subsystem</i>
</font></big></h1>
- <p>Last Updated: May 4, 2012</p>
+ <p>Last Updated: May 7, 2012</p>
</td>
</tr>
</table>
@@ -3249,6 +3249,10 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
<dd>Build in support for mouse input.
<dt><code>CONFIG_NX_KBD</code>:
<dd>Build in support of keypad/keyboard input.
+ <dt><code>CONFIG_NX_WRITEONLY</code>:
+ <dd>Define if the underlying graphics device does not support read operations.
+ Automatically defined if <code>CONFIG_NX_LCDDRIVER</code> and <code>CONFIG_LCD_NOGETRUN</code>
+ are defined.
</dl>
</ul>
@@ -3364,10 +3368,6 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
Default: The smallest enabled pixel depth. (see <code>CONFIG_NX_DISABLE_*BPP</code>)
<dt><code>CONFIG_NXCONSOLE_CURSORCHAR</code>:
<dd>The bitmap code to use as the cursor. Default '_'
- <dt><code>CONFIG_NXCONSOLE_NOGETRUN</code>:
- <dd>NxConsole needs to know if it can read from the LCD or not.
- If reading from the LCD is supported, then NxConsole can do more efficient scrolling.
- Default: Supported
<dt><code>CONFIG_NXCONSOLE_MXCHARS</code>:
<dd>NxConsole needs to remember every character written to the console so that it can redraw the window.
This setting determines the size of some internal memory allocations used to hold the character data.
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 23c4126790..4c3e93a6ac 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -5372,6 +5372,12 @@ build
hardware, this value should be undefined or set to 1.
</li>
<li>
+ <code>CONFIG_NX_WRITEONLY</code>:
+ Define if the underlying graphics device does not support read operations.
+ Automatically defined if <code>CONFIG_NX_LCDDRIVER</code> and <code>CONFIG_LCD_NOGETRUN</code>
+ are defined.
+ </li>
+ <li>
<code>CONFIG_NX_DISABLE_1BPP</code>, <code>CONFIG_NX_DISABLE_2BPP</code>,
<code>CONFIG_NX_DISABLE_4BPP</code>, <code>CONFIG_NX_DISABLE_8BPP</code>
<code>CONFIG_NX_DISABLE_16BPP</code>, <code>CONFIG_NX_DISABLE_24BPP</code>, and
@@ -5406,6 +5412,12 @@ build
see if any of these are supported by the board LCD logic.
</li>
<li>
+ <code>CONFIG_LCD_NOGETRUN</code>:
+ NX components need to know if it can read from the LCD or not.
+ If reading from the LCD is supported, then NxConsole can do more efficient scrolling.
+ Default: Supported
+ </li>
+ <li>
<code>CONFIG_NX_MOUSE</code>:
Build in support for mouse input.
</li>
diff --git a/nuttx/configs/sim/nx/defconfig b/nuttx/configs/sim/nx/defconfig
index e34dadcd87..87b714a94d 100644
--- a/nuttx/configs/sim/nx/defconfig
+++ b/nuttx/configs/sim/nx/defconfig
@@ -430,10 +430,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -457,7 +453,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=8
-# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
diff --git a/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig
index 5b23678d66..aa95af7f8d 100644
--- a/nuttx/configs/sim/nx11/defconfig
+++ b/nuttx/configs/sim/nx11/defconfig
@@ -437,10 +437,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -464,7 +460,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=32
-# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
diff --git a/nuttx/configs/sim/nxwm/defconfig b/nuttx/configs/sim/nxwm/defconfig
index 37281ec7fd..01b152122d 100644
--- a/nuttx/configs/sim/nxwm/defconfig
+++ b/nuttx/configs/sim/nxwm/defconfig
@@ -581,10 +581,6 @@ CONFIG_NXWM_UNITTEST=y
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -608,7 +604,6 @@ CONFIG_NXWM_UNITTEST=y
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=32
-# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
diff --git a/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig
index a71b7bad0f..ebe8fc5be5 100644
--- a/nuttx/configs/stm3210e-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3210e-eval/nsh2/defconfig
@@ -1062,10 +1062,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -1089,7 +1085,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -1098,6 +1093,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3210E-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -1117,6 +1116,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_STM32_TIM1) is not defined, then a simple on/off backlight
# is provided.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
CONFIG_LCD_RPORTRAIT=y
diff --git a/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig
index fb45f6e763..5488ae8910 100644
--- a/nuttx/configs/stm3210e-eval/nx/defconfig
+++ b/nuttx/configs/stm3210e-eval/nx/defconfig
@@ -912,10 +912,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -939,7 +935,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -948,6 +943,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3210E-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -967,6 +966,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_STM32_TIM1) is not defined, then a simple on/off backlight
# is provided.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
CONFIG_LCD_RPORTRAIT=y
diff --git a/nuttx/configs/stm3210e-eval/nxconsole/defconfig b/nuttx/configs/stm3210e-eval/nxconsole/defconfig
index a767968fde..a84fc81344 100644
--- a/nuttx/configs/stm3210e-eval/nxconsole/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxconsole/defconfig
@@ -920,10 +920,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -947,7 +943,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -956,6 +951,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3210E-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -975,6 +974,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_STM32_TIM1) is not defined, then a simple on/off backlight
# is provided.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=y
CONFIG_LCD_PORTRAIT=n
CONFIG_LCD_RPORTRAIT=n
diff --git a/nuttx/configs/stm3210e-eval/nxlines/defconfig b/nuttx/configs/stm3210e-eval/nxlines/defconfig
index 3a52bc1759..b1e4f960a8 100644
--- a/nuttx/configs/stm3210e-eval/nxlines/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxlines/defconfig
@@ -911,10 +911,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -938,7 +934,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -947,6 +942,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3210E-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -966,6 +965,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_STM32_TIM1) is not defined, then a simple on/off backlight
# is provided.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
CONFIG_LCD_RPORTRAIT=y
diff --git a/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig
index a99456351c..097287fb47 100644
--- a/nuttx/configs/stm3210e-eval/nxtext/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxtext/defconfig
@@ -911,10 +911,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -938,7 +934,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -947,6 +942,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3210E-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -966,6 +965,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_STM32_TIM1) is not defined, then a simple on/off backlight
# is provided.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
CONFIG_LCD_RPORTRAIT=y
diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig
index 025bef7527..667bc19cf9 100644
--- a/nuttx/configs/stm3240g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh/defconfig
@@ -1207,10 +1207,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -1234,7 +1230,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -1243,6 +1238,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3240G-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# CONFIG_LCD_RLANDSCAPE - Define for 320x240 display "reverse
@@ -1257,6 +1256,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# STM3240G-EVAL's LCD ribbon cable is at the top of the display.
# Default is 320x240 "landscape" orientation.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=n
CONFIG_LCD_RLANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
diff --git a/nuttx/configs/stm3240g-eval/nxconsole/defconfig b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
index 57ca2b9729..68bc045fbe 100644
--- a/nuttx/configs/stm3240g-eval/nxconsole/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
@@ -1207,10 +1207,6 @@ CONFIG_NX_MXCLIENTMSGS=16
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -1234,7 +1230,6 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -1243,6 +1238,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3240G-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -1258,6 +1257,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# STM3240G-EVAL's LCD ribbon cable is at the top of the display.
# Default is 320x240 "landscape" orientation.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=y
CONFIG_LCD_RLANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
diff --git a/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig
index ed47cfe2a7..73686f67fc 100644
--- a/nuttx/configs/stm3240g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxwm/defconfig
@@ -1272,10 +1272,6 @@ CONFIG_NXWM_UNITTEST=y
# Currently, NxConsole supports only a single pixel depth. This
# configuration setting must be provided to support that single pixel depth.
# Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
-# CONFIG_NXCONSOLE_NOGETRUN
-# NxConsole needs to know if it can read from the LCD or not. If reading
-# from the LCD is supported, then NxConsole can do more efficient
-# scrolling. Default: Supported
# CONFIG_NXCONSOLE_MXCHARS
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
@@ -1299,7 +1295,6 @@ CONFIG_NXWM_UNITTEST=y
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=16
-CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
@@ -1308,6 +1303,10 @@ CONFIG_NXCONSOLE_CACHESIZE=32
#
# STM3240G-EVAL LCD Hardware Configuration
#
+# CONFIG_LCD_NOGETRUN
+# NX components need to know if it can read from the LCD or not. If reading
+# from the LCD is supported, then NxConsole can do more efficient
+# scrolling. Default: Supported
# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape"
# support. Default is this 320x240 "landscape" orientation
# (this setting is informative only... not used).
@@ -1323,6 +1322,7 @@ CONFIG_NXCONSOLE_CACHESIZE=32
# STM3240G-EVAL's LCD ribbon cable is at the top of the display.
# Default is 320x240 "landscape" orientation.
#
+CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_LANDSCAPE=y
CONFIG_LCD_RLANDSCAPE=n
CONFIG_LCD_PORTRAIT=n
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index 3cd213247e..180c568d8a 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/graphics/README.txt
@@ -240,6 +240,10 @@ CONFIG_NX_NPLANES
Some YUV color formats requires support for multiple planes, one for each
color component. Unless you have such special hardware, this value should be
undefined or set to 1.
+CONFIG_NX_WRITEONLY
+ Define if the underlying graphics device does not support read operations.
+ Automatically defined if CONFIG_NX_LCDDRIVER and CONFIG_LCD_NOGETRUN are
+ defined.
CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
@@ -331,10 +335,6 @@ CONFIG_NXCONSOLE_BPP
Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
CONFIG_NXCONSOLE_CURSORCHAR
The bitmap code to use as the cursor. Default '_'
-CONFIG_NXCONSOLE_NOGETRUN
- NxConsole needs to know if it can read from the LCD or not. If reading
- from the LCD is supported, then NxConsole can do more efficient
- scrolling. Default: Supported
CONFIG_NXCONSOLE_MXCHARS
NxConsole needs to remember every character written to the console so
that it can redraw the window. This setting determines the size of some
diff --git a/nuttx/graphics/nxconsole/nx_register.c b/nuttx/graphics/nxconsole/nx_register.c
index c009720347..8ebe0c0d5e 100644
--- a/nuttx/graphics/nxconsole/nx_register.c
+++ b/nuttx/graphics/nxconsole/nx_register.c
@@ -55,7 +55,7 @@
static int nxcon_fill(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxcon_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
@@ -73,7 +73,7 @@ static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
static const struct nxcon_operations_s g_nxops =
{
nxcon_fill,
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
nxcon_move,
#endif
nxcon_bitmap
@@ -123,7 +123,7 @@ static int nxcon_fill(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxcon_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
diff --git a/nuttx/graphics/nxconsole/nxcon_internal.h b/nuttx/graphics/nxconsole/nxcon_internal.h
index 10341f0cfc..3ca84329ba 100644
--- a/nuttx/graphics/nxconsole/nxcon_internal.h
+++ b/nuttx/graphics/nxconsole/nxcon_internal.h
@@ -99,7 +99,7 @@ struct nxcon_operations_s
int (*fill)(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
int (*move)(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
diff --git a/nuttx/graphics/nxconsole/nxcon_scroll.c b/nuttx/graphics/nxconsole/nxcon_scroll.c
index 882c99ed8c..c1a0fec950 100755
--- a/nuttx/graphics/nxconsole/nxcon_scroll.c
+++ b/nuttx/graphics/nxconsole/nxcon_scroll.c
@@ -87,7 +87,7 @@
* only.
****************************************************************************/
-#ifdef CONFIG_NXCONSOLE_NOGETRUN
+#ifdef CONFIG_NX_WRITEONLY
static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
int bottom, int scrollheight)
{
diff --git a/nuttx/graphics/nxconsole/nxtk_register.c b/nuttx/graphics/nxconsole/nxtk_register.c
index 6ea239d742..0a11fc6cfe 100644
--- a/nuttx/graphics/nxconsole/nxtk_register.c
+++ b/nuttx/graphics/nxconsole/nxtk_register.c
@@ -55,7 +55,7 @@
static int nxtkcon_fill(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxtkcon_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
@@ -73,7 +73,7 @@ static int nxtkcon_bitmap(FAR struct nxcon_state_s *priv,
static const struct nxcon_operations_s g_nxtkops =
{
nxtkcon_fill,
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
nxtkcon_move,
#endif
nxtkcon_bitmap
@@ -123,7 +123,7 @@ static int nxtkcon_fill(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxtkcon_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
diff --git a/nuttx/graphics/nxconsole/nxtool_register.c b/nuttx/graphics/nxconsole/nxtool_register.c
index c5273d5f68..b063d5a613 100644
--- a/nuttx/graphics/nxconsole/nxtool_register.c
+++ b/nuttx/graphics/nxconsole/nxtool_register.c
@@ -55,7 +55,7 @@
static int nxtool_fill(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxtool_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
@@ -73,7 +73,7 @@ static int nxtool_bitmap(FAR struct nxcon_state_s *priv,
static const struct nxcon_operations_s g_nxtoolops =
{
nxtool_fill,
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
nxtool_move,
#endif
nxtool_bitmap
@@ -123,7 +123,7 @@ static int nxtool_fill(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-#ifndef CONFIG_NXCONSOLE_NOGETRUN
+#ifndef CONFIG_NX_WRITEONLY
static int nxtool_move(FAR struct nxcon_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
diff --git a/nuttx/include/nuttx/nx/nx.h b/nuttx/include/nuttx/nx/nx.h
index 0e908f7c51..bba098398f 100644
--- a/nuttx/include/nuttx/nx/nx.h
+++ b/nuttx/include/nuttx/nx/nx.h
@@ -65,13 +65,18 @@
/****************************************************************************
* Public Types
****************************************************************************/
-
/* Configuration ************************************************************/
#ifndef CONFIG_NX_NPLANES
# define CONFIG_NX_NPLANES 1 /* Max number of color planes supported */
#endif
+/* Check if the underlying graphic device supports read operations */
+
+#if !defined(CONFIG_NX_WRITEONLY) && defined(CONFIG_NX_LCDDRIVER) && defined(CONFIG_LCD_NOGETRUN)
+# define CONFIG_NX_WRITEONLY 1
+#endif
+
/* Handles ******************************************************************/
/* The interface to the NX server is managed using a opaque handle: */
diff --git a/nuttx/include/nuttx/nx/nxconsole.h b/nuttx/include/nuttx/nx/nxconsole.h
index 48ac3eacd8..7b4bb5f3df 100644
--- a/nuttx/include/nuttx/nx/nxconsole.h
+++ b/nuttx/include/nuttx/nx/nxconsole.h
@@ -71,10 +71,6 @@
* Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
* CONFIG_NXCONSOLE_CURSORCHAR
* The bitmap code to use as the cursor. Default '_'
- * CONFIG_NXCONSOLE_NOGETRUN
- * NxConsole needs to know if it can read from the LCD or not. If reading
- * from the LCD is supported, then NxConsole can do more efficient
- * scrolling. Default: Supported
* CONFIG_NXCONSOLE_MXCHARS
* NxConsole needs to remember every character written to the console so
* that it can redraw the window. This setting determines the size of some