summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-20 15:53:28 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-20 15:53:28 -0600
commit77e4ba3764c959d1ddf5605496197f2f443c52d9 (patch)
treeda292fd81f472e98deff8be63b78a3c9645e7801
parent8ae7ecf5a4ba19ce28b91730ac100ab7c03d5a7c (diff)
downloadnuttx-77e4ba3764c959d1ddf5605496197f2f443c52d9.tar.gz
nuttx-77e4ba3764c959d1ddf5605496197f2f443c52d9.tar.bz2
nuttx-77e4ba3764c959d1ddf5605496197f2f443c52d9.zip
More naming changes to get the stm3240g-eval/nxterm configuration building again
-rw-r--r--NxWidgets/libnxwidgets/src/ccallback.cxx2
-rw-r--r--NxWidgets/libnxwidgets/src/cnxserver.cxx2
-rw-r--r--NxWidgets/nxwm/include/cnxterm.h2
-rw-r--r--NxWidgets/nxwm/src/cnxterm.cxx92
-rw-r--r--apps/examples/README.txt4
-rw-r--r--nuttx/Documentation/NXGraphicsSubsystem.html2
-rw-r--r--nuttx/arch/arm/src/common/up_arch.h9
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_i2c.c9
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_i2c_alt.c9
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_serial.c9
-rw-r--r--nuttx/configs/stm3240g-eval/include/board.h8
-rw-r--r--nuttx/configs/stm3240g-eval/nxterm/defconfig2
-rw-r--r--nuttx/graphics/Kconfig2
-rw-r--r--nuttx/graphics/Makefile4
-rw-r--r--nuttx/graphics/README.txt2
-rw-r--r--nuttx/graphics/nxterm/Make.defs14
-rw-r--r--nuttx/graphics/nxterm/nx_register.c34
-rw-r--r--nuttx/graphics/nxterm/nxterm.h (renamed from nuttx/graphics/nxterm/nxcon_internal.h)86
-rw-r--r--nuttx/graphics/nxterm/nxterm_driver.c (renamed from nuttx/graphics/nxterm/nxcon_driver.c)56
-rw-r--r--nuttx/graphics/nxterm/nxterm_font.c (renamed from nuttx/graphics/nxterm/nxcon_font.c)114
-rw-r--r--nuttx/graphics/nxterm/nxterm_kbdin.c (renamed from nuttx/graphics/nxterm/nxcon_kbdin.c)64
-rw-r--r--nuttx/graphics/nxterm/nxterm_putc.c (renamed from nuttx/graphics/nxterm/nxcon_putc.c)38
-rw-r--r--nuttx/graphics/nxterm/nxterm_redraw.c (renamed from nuttx/graphics/nxterm/nxcon_redraw.c)18
-rw-r--r--nuttx/graphics/nxterm/nxterm_register.c (renamed from nuttx/graphics/nxterm/nxcon_register.c)24
-rw-r--r--nuttx/graphics/nxterm/nxterm_scroll.c (renamed from nuttx/graphics/nxterm/nxcon_scroll.c)26
-rw-r--r--nuttx/graphics/nxterm/nxterm_sem.c (renamed from nuttx/graphics/nxterm/nxcon_sem.c)10
-rw-r--r--nuttx/graphics/nxterm/nxterm_unregister.c (renamed from nuttx/graphics/nxterm/nxcon_unregister.c)14
-rw-r--r--nuttx/graphics/nxterm/nxterm_vt100.c (renamed from nuttx/graphics/nxterm/nxcon_vt100.c)38
-rw-r--r--nuttx/graphics/nxterm/nxtk_register.c20
-rw-r--r--nuttx/graphics/nxterm/nxtool_register.c20
-rw-r--r--nuttx/include/nuttx/nx/nxterm.h40
31 files changed, 391 insertions, 383 deletions
diff --git a/NxWidgets/libnxwidgets/src/ccallback.cxx b/NxWidgets/libnxwidgets/src/ccallback.cxx
index 46108acf3..77714d208 100644
--- a/NxWidgets/libnxwidgets/src/ccallback.cxx
+++ b/NxWidgets/libnxwidgets/src/ccallback.cxx
@@ -214,7 +214,7 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh,
{
// Keyboard input is going to an NxTerm
- nxcon_kbdin(This->m_nxterm, str, nCh);
+ nxterm_kbdin(This->m_nxterm, str, nCh);
}
else
#endif
diff --git a/NxWidgets/libnxwidgets/src/cnxserver.cxx b/NxWidgets/libnxwidgets/src/cnxserver.cxx
index e87c0fdf6..d47fa74c1 100644
--- a/NxWidgets/libnxwidgets/src/cnxserver.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxserver.cxx
@@ -393,7 +393,7 @@ int CNxServer::server(int argc, char *argv[])
ret = up_fbinitialize();
if (ret < 0)
{
- gdbg("nxcon_server: up_fbinitialize failed: %d\n", -ret);
+ gdbg("nxterm_server: up_fbinitialize failed: %d\n", -ret);
return EXIT_FAILURE;
}
diff --git a/NxWidgets/nxwm/include/cnxterm.h b/NxWidgets/nxwm/include/cnxterm.h
index c97e3b911..ab188f237 100644
--- a/NxWidgets/nxwm/include/cnxterm.h
+++ b/NxWidgets/nxwm/include/cnxterm.h
@@ -80,7 +80,7 @@ namespace NxWM
private:
CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
CApplicationWindow *m_window; /**< Reference to the application window */
- NXTERMi m_nxcon; /**< NxTerm handle */
+ NXTERMi m_nxterm; /**< NxTerm handle */
pid_t m_pid; /**< Task ID of the NxTerm thread */
/**
diff --git a/NxWidgets/nxwm/src/cnxterm.cxx b/NxWidgets/nxwm/src/cnxterm.cxx
index a26009a4d..84fc69109 100644
--- a/NxWidgets/nxwm/src/cnxterm.cxx
+++ b/NxWidgets/nxwm/src/cnxterm.cxx
@@ -79,14 +79,14 @@ namespace NxWM
struct SNxTerm
{
- FAR void *console; /**< The console 'this' pointer use with on_exit() */
- sem_t exclSem; /**< Sem that gives exclusive access to this structure */
- sem_t waitSem; /**< Sem that posted when the task is initialized */
- NXTKWINDOW hwnd; /**< Window handle */
- NXTERM nxcon; /**< NxTerm handle */
- int minor; /**< Next device minor number */
- struct nxcon_window_s wndo; /**< Describes the NxTerm window */
- bool result; /**< True if successfully initialized */
+ FAR void *console; /**< The console 'this' pointer use with on_exit() */
+ sem_t exclSem; /**< Sem that gives exclusive access to this structure */
+ sem_t waitSem; /**< Sem that posted when the task is initialized */
+ NXTKWINDOW hwnd; /**< Window handle */
+ NXTERM nxterm; /**< NxTerm handle */
+ int minor; /**< Next device minor number */
+ struct nxterm_window_s wndo; /**< Describes the NxTerm window */
+ bool result; /**< True if successfully initialized */
};
/********************************************************************************************
@@ -98,7 +98,7 @@ namespace NxWM
* assure that the NxTerm is successfully started.
*/
- static struct SNxTerm g_nxconvars;
+ static struct SNxTerm g_nxtermvars;
}
/********************************************************************************************
@@ -127,7 +127,7 @@ CNxTerm::CNxTerm(CTaskbar *taskbar, CApplicationWindow *window)
// The NxTerm is not runing
m_pid = -1;
- m_nxcon = 0;
+ m_nxterm = 0;
// Add our personalized window label
@@ -205,7 +205,7 @@ bool CNxTerm::run(void)
{
// Some sanity checking
- if (m_pid >= 0 || m_nxcon != 0)
+ if (m_pid >= 0 || m_nxterm != 0)
{
gdbg("ERROR: All ready running or connected\n");
return false;
@@ -213,7 +213,7 @@ bool CNxTerm::run(void)
// Get exclusive access to the global data structure
- if (sem_wait(&g_nxconvars.exclSem) != 0)
+ if (sem_wait(&g_nxtermvars.exclSem) != 0)
{
// This might fail if a signal is received while we are waiting.
@@ -231,23 +231,23 @@ bool CNxTerm::run(void)
// Get the window handle from the widget control
- g_nxconvars.hwnd = control->getWindowHandle();
+ g_nxtermvars.hwnd = control->getWindowHandle();
// Describe the NxTerm
- g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR;
- g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR;
- g_nxconvars.wndo.fontid = CONFIG_NXWM_NXTERM_FONTID;
+ g_nxtermvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR;
+ g_nxtermvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR;
+ g_nxtermvars.wndo.fontid = CONFIG_NXWM_NXTERM_FONTID;
// Get the size of the window
- (void)window->getSize(&g_nxconvars.wndo.wsize);
+ (void)window->getSize(&g_nxtermvars.wndo.wsize);
// Start the NxTerm task
- g_nxconvars.console = (FAR void *)this;
- g_nxconvars.result = false;
- g_nxconvars.nxcon = 0;
+ g_nxtermvars.console = (FAR void *)this;
+ g_nxtermvars.result = false;
+ g_nxtermvars.nxterm = 0;
sched_lock();
m_pid = task_create("NxTerm", CONFIG_NXWM_NXTERM_PRIO,
@@ -270,20 +270,20 @@ bool CNxTerm::run(void)
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_sec += 2;
- int ret = sem_timedwait(&g_nxconvars.waitSem, &abstime);
+ int ret = sem_timedwait(&g_nxtermvars.waitSem, &abstime);
sched_unlock();
- if (ret == OK && g_nxconvars.result)
+ if (ret == OK && g_nxtermvars.result)
{
// Re-direct NX keyboard input to the new NxTerm driver
- DEBUGASSERT(g_nxconvars.nxcon != 0);
+ DEBUGASSERT(g_nxtermvars.nxterm != 0);
#ifdef CONFIG_NXTERM_NXKBDIN
- window->redirectNxTerm(g_nxconvars.nxcon);
+ window->redirectNxTerm(g_nxtermvars.nxterm);
#endif
// Save the handle to use in the stop method
- m_nxcon = g_nxconvars.nxcon;
+ m_nxterm = g_nxtermvars.nxterm;
}
else
{
@@ -296,7 +296,7 @@ bool CNxTerm::run(void)
}
}
- sem_post(&g_nxconvars.exclSem);
+ sem_post(&g_nxtermvars.exclSem);
return result;
}
@@ -327,7 +327,7 @@ void CNxTerm::stop(void)
// Destroy the NX console device
- if (m_nxcon)
+ if (m_nxterm)
{
// Re-store NX keyboard input routing
@@ -338,8 +338,8 @@ void CNxTerm::stop(void)
// Unregister the NxTerm driver
- nxcon_unregister(m_nxcon);
- m_nxcon = 0;
+ nxterm_unregister(m_nxterm);
+ m_nxterm = 0;
}
}
@@ -398,7 +398,7 @@ void CNxTerm::redraw(void)
rect.pt2.x = windowSize.w - 1;
rect.pt2.y = windowSize.h - 1;
- nxcon_redraw(m_nxcon, &rect, false);
+ nxterm_redraw(m_nxterm, &rect, false);
}
/**
@@ -428,7 +428,7 @@ int CNxTerm::nxterm(int argc, char *argv[])
// Set up an on_exit() event that will be called when this task exits
- if (on_exit(exitHandler, g_nxconvars.console) != 0)
+ if (on_exit(exitHandler, g_nxtermvars.console) != 0)
{
gdbg("ERROR: on_exit failed\n");
goto errout;
@@ -436,9 +436,9 @@ int CNxTerm::nxterm(int argc, char *argv[])
// Use the window handle to create the NX console
- g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &g_nxconvars.wndo,
- g_nxconvars.minor);
- if (!g_nxconvars.nxcon)
+ g_nxtermvars.nxterm = nxtk_register(g_nxtermvars.hwnd, &g_nxtermvars.wndo,
+ g_nxtermvars.minor);
+ if (!g_nxtermvars.nxterm)
{
gdbg("ERROR: Failed register the console device\n");
goto errout;
@@ -447,11 +447,11 @@ int CNxTerm::nxterm(int argc, char *argv[])
// Construct the driver name using this minor number
char devname[32];
- snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor);
+ snprintf(devname, 32, "/dev/nxterm%d", g_nxtermvars.minor);
// Increment the minor number while it is protect by the semaphore
- g_nxconvars.minor++;
+ g_nxtermvars.minor++;
// Open the NxTerm driver
@@ -463,7 +463,7 @@ int CNxTerm::nxterm(int argc, char *argv[])
if (fd < 0)
{
gdbg("ERROR: Failed open the console device\n");
- goto errout_with_nxcon;
+ goto errout_with_nxterm;
}
// Now re-direct stdout and stderr so that they use the NX console driver.
@@ -498,8 +498,8 @@ int CNxTerm::nxterm(int argc, char *argv[])
// Inform the parent thread that we successfully initialized
- g_nxconvars.result = true;
- sem_post(&g_nxconvars.waitSem);
+ g_nxtermvars.result = true;
+ sem_post(&g_nxtermvars.waitSem);
// Run the NSH console
@@ -513,13 +513,13 @@ int CNxTerm::nxterm(int argc, char *argv[])
return EXIT_SUCCESS;
-errout_with_nxcon:
- nxcon_unregister(g_nxconvars.nxcon);
+errout_with_nxterm:
+ nxterm_unregister(g_nxtermvars.nxterm);
errout:
- g_nxconvars.nxcon = 0;
- g_nxconvars.result = false;
- sem_post(&g_nxconvars.waitSem);
+ g_nxtermvars.nxterm = 0;
+ g_nxtermvars.result = false;
+ sem_post(&g_nxtermvars.waitSem);
return EXIT_FAILURE;
}
@@ -645,8 +645,8 @@ bool NxWM::nshlibInitialize(void)
{
// Initialize the global data structure
- sem_init(&g_nxconvars.exclSem, 0, 1);
- sem_init(&g_nxconvars.waitSem, 0, 0);
+ sem_init(&g_nxtermvars.exclSem, 0, 1);
+ sem_init(&g_nxtermvars.waitSem, 0, 0);
// Initialize the NSH library
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index a20fc80ff..09c155efc 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -860,10 +860,10 @@ examples/nxterm
#endif
CONFIG_EXAMPLES_NXCON_MINOR -- The NX console device minor number.
- Default is 0 corresponding to /dev/nxcon0
+ Default is 0 corresponding to /dev/nxterm0
CONFIG_EXAMPLES_NXCON_DEVNAME -- The quoated, full path to the
NX console device corresponding to CONFIG_EXAMPLES_NXCON_MINOR.
- Default: "/dev/nxcon0"
+ Default: "/dev/nxterm0"
CONFIG_EXAMPLES_NXTERM_PRIO - Priority of the NxTerm task.
Default: SCHED_PRIORITY_DEFAULT
CONFIG_EXAMPLES_NXTERM_STACKSIZE - Stack size allocated for the
diff --git a/nuttx/Documentation/NXGraphicsSubsystem.html b/nuttx/Documentation/NXGraphicsSubsystem.html
index 99b713428..5c1c1ed81 100644
--- a/nuttx/Documentation/NXGraphicsSubsystem.html
+++ b/nuttx/Documentation/NXGraphicsSubsystem.html
@@ -3426,7 +3426,7 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
<dt><code>CONFIG_NXTERM_NXKBDIN</code>:
<dd>Take input from the NX keyboard input callback.
By default, keyboard input is taken from stdin (<code>/dev/console</code>).
- If this option is set, then the interface<code>nxcon_kdbin()</code> is enabled.
+ If this option is set, then the interface<code>nxterm_kdbin()</code> is enabled.
That interface may be driven by window callback functions so that keyboard input <i>only</i> goes to the top window.
<dt><code>CONFIG__NXTERM_KBDBUFSIZE</code>:
<dd>If <code>CONFIG_NXTERM_NXKBDIN</code> is enabled, then this value may be used to
diff --git a/nuttx/arch/arm/src/common/up_arch.h b/nuttx/arch/arm/src/common/up_arch.h
index af29bbf65..fc6981efb 100644
--- a/nuttx/arch/arm/src/common/up_arch.h
+++ b/nuttx/arch/arm/src/common/up_arch.h
@@ -85,16 +85,17 @@ static inline void putreg16(uint16_t val, unsigned int addr)
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
#define EXTERN extern
#endif
/* Atomic modification of registers */
-EXTERN void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits);
-EXTERN void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
-EXTERN void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
+void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits);
+void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
+void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
#undef EXTERN
#if defined(__cplusplus)
diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c
index f10460b35..cd4714fd4 100644
--- a/nuttx/arch/arm/src/stm32/stm32_i2c.c
+++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c
@@ -1601,21 +1601,24 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev;
FAR struct stm32_i2c_priv_s *priv = inst->priv;
uint32_t status = 0;
+#ifdef I2C1_FSMC_CONFLICT
uint32_t ahbenr;
+#endif
int errval = 0;
ASSERT(count);
+#ifdef I2C1_FSMC_CONFLICT
/* Disable FSMC that shares a pin with I2C1 (LBAR) */
ahbenr = stm32_i2c_disablefsmc(priv);
+#else
/* Wait for any STOP in progress. NOTE: If we have to disable the FSMC
* then we cannot do this at the top of the loop, unfortunately. The STOP
* will not complete normally if the FSMC is enabled.
*/
-#ifndef I2C1_FSMC_CONFLICT
stm32_i2c_sem_waitstop(priv);
#endif
@@ -1755,18 +1758,18 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
stm32_i2c_tracedump(priv);
+#ifdef I2C1_FSMC_CONFLICT
/* Wait for any STOP in progress. NOTE: If we have to disable the FSMC
* then we cannot do this at the top of the loop, unfortunately. The STOP
* will not complete normally if the FSMC is enabled.
*/
-#ifdef I2C1_FSMC_CONFLICT
stm32_i2c_sem_waitstop(priv);
-#endif
/* Re-enable the FSMC */
stm32_i2c_enablefsmc(ahbenr);
+#endif
stm32_i2c_sem_post(dev);
return -errval;
diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c
index 63c329691..9a6e90999 100755
--- a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c
+++ b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c
@@ -2103,21 +2103,24 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev;
FAR struct stm32_i2c_priv_s *priv = inst->priv;
uint32_t status = 0;
+#ifdef I2C1_FSMC_CONFLICT
uint32_t ahbenr;
+#endif
int errval = 0;
ASSERT(count);
+#ifdef I2C1_FSMC_CONFLICT
/* Disable FSMC that shares a pin with I2C1 (LBAR) */
ahbenr = stm32_i2c_disablefsmc(priv);
+#else
/* Wait for any STOP in progress. NOTE: If we have to disable the FSMC
* then we cannot do this at the top of the loop, unfortunately. The STOP
* will not complete normally if the FSMC is enabled.
*/
-#ifndef I2C1_FSMC_CONFLICT
stm32_i2c_sem_waitstop(priv);
#endif
@@ -2283,18 +2286,18 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
stm32_i2c_tracedump(priv);
+#ifdef I2C1_FSMC_CONFLICT
/* Wait for any STOP in progress. NOTE: If we have to disable the FSMC
* then we cannot do this at the top of the loop, unfortunately. The STOP
* will not complete normally if the FSMC is enabled.
*/
-#ifdef I2C1_FSMC_CONFLICT
stm32_i2c_sem_waitstop(priv);
-#endif
/* Re-enable the FSMC */
stm32_i2c_enablefsmc(ahbenr);
+#endif
stm32_i2c_sem_post(dev);
return -errval;
diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
index de499ab08..f2de1642e 100644
--- a/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ b/nuttx/arch/arm/src/stm32/stm32_serial.c
@@ -68,7 +68,7 @@
#include "up_internal.h"
/****************************************************************************
- * Definitions
+ * Preprocessor Definitions
****************************************************************************/
/* Some sanity checks *******************************************************/
/* DMA configuration */
@@ -1308,8 +1308,6 @@ static void up_set_format(struct uart_dev_s *dev)
#endif
up_serialout(priv, STM32_USART_CR3_OFFSET, regval);
-
-#endif
}
#endif /* CONFIG_SUPPRESS_UART_CONFIG */
@@ -1327,7 +1325,7 @@ static void up_set_format(struct uart_dev_s *dev)
static void up_set_apb_clock(struct uart_dev_s *dev, bool on)
{
- struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
+ struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
uint32_t rcc_en;
uint32_t regaddr;
@@ -2331,7 +2329,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
* Name: up_txready
*
* Description:
- * Return true if the tranmsit data register is empty
+ * Return true if the transmit data register is empty
*
****************************************************************************/
@@ -2530,6 +2528,7 @@ static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate)
return OK;
}
#endif
+#endif /* HAVE_UART */
#endif /* USE_SERIALDRIVER */
/****************************************************************************
diff --git a/nuttx/configs/stm3240g-eval/include/board.h b/nuttx/configs/stm3240g-eval/include/board.h
index a531c220c..bb57d025f 100644
--- a/nuttx/configs/stm3240g-eval/include/board.h
+++ b/nuttx/configs/stm3240g-eval/include/board.h
@@ -1,4 +1,4 @@
-
+/************************************************************************************
* configs/stm3240g-eval/include/board.h
* include/arch/board/board.h
*
@@ -42,22 +42,24 @@
************************************************************************************/
#include <nuttx/config.h>
+
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
+
#include "stm32_rcc.h"
#include "stm32_sdio.h"
#include "stm32.h"
/************************************************************************************
- * Definitions
+ * Pre-processor Definitions
************************************************************************************/
/* Clocking *************************************************************************/
/* Four clock sources are available on STM3240G-EVAL evaluation board for
* STM32F407IGH6 and RTC embedded:
*
- * X1, 25 MHz crystal for ethernet PHY with socket. It can be removed when clock is
+ * X1, 25 MHz crystal for Ethernet PHY with socket. It can be removed when clock is
* provided by MCO pin of the MCU
* X2, 26 MHz crystal for USB OTG HS PHY
* X3, 32 kHz crystal for embedded RTC
diff --git a/nuttx/configs/stm3240g-eval/nxterm/defconfig b/nuttx/configs/stm3240g-eval/nxterm/defconfig
index 3d0b816e0..1b4fa7d81 100644
--- a/nuttx/configs/stm3240g-eval/nxterm/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxterm/defconfig
@@ -428,7 +428,7 @@ CONFIG_SCHED_WAITPID=y
# CONFIG_SCHED_STARTHOOK is not set
# CONFIG_SCHED_ATEXIT is not set
# CONFIG_SCHED_ONEXIT is not set
-CONFIG_USER_ENTRYPOINT="nsh_main"
+CONFIG_USER_ENTRYPOINT="nxterm_main"
CONFIG_DISABLE_OS_API=y
# CONFIG_DISABLE_POSIX_TIMERS is not set
# CONFIG_DISABLE_PTHREAD is not set
diff --git a/nuttx/graphics/Kconfig b/nuttx/graphics/Kconfig
index 0b21d997a..f001f83fc 100644
--- a/nuttx/graphics/Kconfig
+++ b/nuttx/graphics/Kconfig
@@ -436,7 +436,7 @@ config NXTERM_NXKBDIN
---help---
Take input from the NX keyboard input callback. By default, keyboard
input is taken from stdin (/dev/console). If this option is set, then
- the interface nxcon_kdbin() is enabled. That interface may be driven
+ the interface nxterm_kdbin() is enabled. That interface may be driven
by window callback functions so that keyboard input *only* goes to the
top window.
diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
index c66f68a1b..d2fbef52d 100644
--- a/nuttx/graphics/Makefile
+++ b/nuttx/graphics/Makefile
@@ -65,10 +65,10 @@ DEPPATH += --dep-path nxterm
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxterm}
endif
-ASRCS = $(NXGLIB_ASRCS) $(NXBE_ASRCS) $(NX_ASRCS) $(NXTK_ASRCS) $(NXCON_ASRCS)
+ASRCS = $(NXGLIB_ASRCS) $(NXBE_ASRCS) $(NX_ASRCS) $(NXTK_ASRCS) $(NXTERM_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
-CSRCS = $(NXGLIB_CSRCS) $(NXBE_CSRCS) $(NX_CSRCS) $(NXTK_CSRCS) $(NXCON_CSRCS)
+CSRCS = $(NXGLIB_CSRCS) $(NXBE_CSRCS) $(NX_CSRCS) $(NXTK_CSRCS) $(NXTERM_CSRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index cfc0e42de..1c0488d87 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/graphics/README.txt
@@ -396,7 +396,7 @@ NxTerm Input options
CONFIG_NXTERM_NXKBDIN
Take input from the NX keyboard input callback. By default, keyboard
input is taken from stdin (/dev/console). If this option is set, then
- the interface nxcon_kdbin() is enabled. That interface may be driven
+ the interface nxterm_kdbin() is enabled. That interface may be driven
by window callback functions so that keyboard input *only* goes to the
top window.
CONFIG__NXTERM_KBDBUFSIZE
diff --git a/nuttx/graphics/nxterm/Make.defs b/nuttx/graphics/nxterm/Make.defs
index 7a44ba263..a6d5e7e14 100644
--- a/nuttx/graphics/nxterm/Make.defs
+++ b/nuttx/graphics/nxterm/Make.defs
@@ -33,16 +33,16 @@
#
############################################################################
-NXCON_ASRCS =
-NXCON_CSRCS = nx_register.c nxcon_driver.c nxcon_font.c nxcon_putc.c
-NXCON_CSRCS += nxcon_redraw.c nxcon_register.c nxcon_scroll.c
-NXCON_CSRCS += nxcon_vt100.c nxcon_unregister.c nxtk_register.c
-NXCON_CSRCS += nxtool_register.c
+NXTERM_ASRCS =
+NXTERM_CSRCS = nx_register.c nxterm_driver.c nxterm_font.c nxterm_putc.c
+NXTERM_CSRCS += nxterm_redraw.c nxterm_register.c nxterm_scroll.c
+NXTERM_CSRCS += nxterm_vt100.c nxterm_unregister.c nxtk_register.c
+NXTERM_CSRCS += nxtool_register.c
ifeq ($(CONFIG_NXTERM_NXKBDIN),y)
-NXCON_CSRCS += nxcon_kbdin.c
+NXTERM_CSRCS += nxterm_kbdin.c
endif
ifeq ($(CONFIG_DEBUG),y)
-NXCON_CSRCS += nxcon_sem.c
+NXTERM_CSRCS += nxterm_sem.c
endif
diff --git a/nuttx/graphics/nxterm/nx_register.c b/nuttx/graphics/nxterm/nx_register.c
index ed84d3d28..52f7c3116 100644
--- a/nuttx/graphics/nxterm/nx_register.c
+++ b/nuttx/graphics/nxterm/nx_register.c
@@ -42,7 +42,7 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxterm.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Pre-processor Definitions
@@ -52,15 +52,15 @@
* Private Function Prototypes
****************************************************************************/
-static int nxcon_fill(FAR struct nxcon_state_s *priv,
+static int nxterm_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
#ifndef CONFIG_NX_WRITEONLY
-static int nxcon_move(FAR struct nxcon_state_s *priv,
+static int nxterm_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
#endif
-static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
+static int nxterm_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -70,13 +70,13 @@ static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
* Private Data
****************************************************************************/
-static const struct nxcon_operations_s g_nxops =
+static const struct nxterm_operations_s g_nxops =
{
- nxcon_fill,
+ nxterm_fill,
#ifndef CONFIG_NX_WRITEONLY
- nxcon_move,
+ nxterm_move,
#endif
- nxcon_bitmap
+ nxterm_bitmap
};
/****************************************************************************
@@ -84,7 +84,7 @@ static const struct nxcon_operations_s g_nxops =
****************************************************************************/
/****************************************************************************
- * Name: nxcon_fill
+ * Name: nxterm_fill
*
* Description:
* Fill the specified rectangle in the window with the specified color
@@ -99,7 +99,7 @@ static const struct nxcon_operations_s g_nxops =
*
****************************************************************************/
-static int nxcon_fill(FAR struct nxcon_state_s *priv,
+static int nxterm_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES])
{
@@ -107,7 +107,7 @@ static int nxcon_fill(FAR struct nxcon_state_s *priv,
}
/****************************************************************************
- * Name: nxcon_move
+ * Name: nxterm_move
*
* Description:
* Move a rectangular region within the window
@@ -124,7 +124,7 @@ static int nxcon_fill(FAR struct nxcon_state_s *priv,
****************************************************************************/
#ifndef CONFIG_NX_WRITEONLY
-static int nxcon_move(FAR struct nxcon_state_s *priv,
+static int nxterm_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
{
@@ -133,7 +133,7 @@ static int nxcon_move(FAR struct nxcon_state_s *priv,
#endif
/****************************************************************************
- * Name: nxcon_bitmap
+ * Name: nxterm_bitmap
*
* Description:
* Copy a rectangular region of a larger image into the rectangle in the
@@ -155,7 +155,7 @@ static int nxcon_move(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
+static int nxterm_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -173,7 +173,7 @@ static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
*
* Description:
* Register a console device on a raw NX window. The device will be
- * registered at /dev/nxconN where N is the provided minor number.
+ * registered at /dev/nxtermN where N is the provided minor number.
*
* Input Parameters:
* hwnd - A handle that will be used to access the window. The window must
@@ -186,8 +186,8 @@ static int nxcon_bitmap(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-NXTERM nx_register(NXWINDOW hwnd, FAR struct nxcon_window_s *wndo, int minor)
+NXTERM nx_register(NXWINDOW hwnd, FAR struct nxterm_window_s *wndo, int minor)
{
- return nxcon_register((NXTERM)hwnd, wndo, &g_nxops, minor);
+ return nxterm_register((NXTERM)hwnd, wndo, &g_nxops, minor);
}
diff --git a/nuttx/graphics/nxterm/nxcon_internal.h b/nuttx/graphics/nxterm/nxterm.h
index 9bee64c3e..9bc2c4e43 100644
--- a/nuttx/graphics/nxterm/nxcon_internal.h
+++ b/nuttx/graphics/nxterm/nxterm.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_internal.h
+ * nuttx/graphics/nxterm/nxterm.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __GRAPHICS_NXTERM_NXCON_INTERNAL_H
-#define __GRAPHICS_NXTERM_NXCON_INTERNAL_H
+#ifndef __GRAPHICS_NXTERM_NXTERM_INTERNAL_H
+#define __GRAPHICS_NXTERM_NXTERM_INTERNAL_H
/****************************************************************************
* Included Files
@@ -67,7 +67,7 @@
/* Device path formats */
-#define NX_DEVNAME_FORMAT "/dev/nxcon%d"
+#define NX_DEVNAME_FORMAT "/dev/nxterm%d"
#define NX_DEVNAME_SIZE 16
/* Semaphore protection */
@@ -83,7 +83,7 @@
****************************************************************************/
/* Identifies the state of the VT100 escape sequence processing */
-enum nxcon_vt100state_e
+enum nxterm_vt100state_e
{
VT100_NOT_CONSUMED = 0, /* Character is not part of a VT100 escape sequence */
VT100_CONSUMED, /* Character was consumed as part of the VT100 escape processing */
@@ -93,18 +93,18 @@ enum nxcon_vt100state_e
/* Describes on set of console window callbacks */
-struct nxcon_state_s;
-struct nxcon_operations_s
+struct nxterm_state_s;
+struct nxterm_operations_s
{
- int (*fill)(FAR struct nxcon_state_s *priv,
+ int (*fill)(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
#ifndef CONFIG_NX_WRITEONLY
- int (*move)(FAR struct nxcon_state_s *priv,
+ int (*move)(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
#endif
- int (*bitmap)(FAR struct nxcon_state_s *priv,
+ int (*bitmap)(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -113,7 +113,7 @@ struct nxcon_operations_s
/* Describes one cached glyph bitmap */
-struct nxcon_glyph_s
+struct nxterm_glyph_s
{
uint8_t code; /* Character code */
uint8_t height; /* Height of this glyph (in rows) */
@@ -125,7 +125,7 @@ struct nxcon_glyph_s
/* Describes on character on the display */
-struct nxcon_bitmap_s
+struct nxterm_bitmap_s
{
uint8_t code; /* Character code */
uint8_t flags; /* See BMFLAGS_* */
@@ -134,11 +134,11 @@ struct nxcon_bitmap_s
/* Describes the state of one NX console driver*/
-struct nxcon_state_s
+struct nxterm_state_s
{
- FAR const struct nxcon_operations_s *ops; /* Window operations */
+ FAR const struct nxterm_operations_s *ops; /* Window operations */
FAR void *handle; /* The window handle */
- FAR struct nxcon_window_s wndo; /* Describes the window and font */
+ FAR struct nxterm_window_s wndo; /* Describes the window and font */
NXHANDLE font; /* The current font handle */
sem_t exclsem; /* Forces mutually exclusive access */
#ifdef CONFIG_DEBUG
@@ -165,12 +165,12 @@ struct nxcon_state_s
/* Font cache data storage */
- struct nxcon_bitmap_s cursor;
- struct nxcon_bitmap_s bm[CONFIG_NXTERM_MXCHARS];
+ struct nxterm_bitmap_s cursor;
+ struct nxterm_bitmap_s bm[CONFIG_NXTERM_MXCHARS];
/* Glyph cache data storage */
- struct nxcon_glyph_s glyph[CONFIG_NXTERM_CACHESIZE];
+ struct nxterm_glyph_s glyph[CONFIG_NXTERM_CACHESIZE];
/* Keyboard input support */
@@ -199,7 +199,7 @@ struct nxcon_state_s
/* This is the common NX driver file operations */
-extern const struct file_operations g_nxcon_drvrops;
+extern const struct file_operations g_nxterm_drvrops;
/****************************************************************************
* Public Function Prototypes
@@ -207,48 +207,48 @@ extern const struct file_operations g_nxcon_drvrops;
/* Semaphore helpers */
#ifdef CONFIG_DEBUG
-int nxcon_semwait(FAR struct nxcon_state_s *priv);
-int nxcon_sempost(FAR struct nxcon_state_s *priv);
+int nxterm_semwait(FAR struct nxterm_state_s *priv);
+int nxterm_sempost(FAR struct nxterm_state_s *priv);
#else
-# define nxcon_semwait(p) sem_wait(&p->exclsem)
-# define nxcon_sempost(p) sem_post(&p->exclsem)
+# define nxterm_semwait(p) sem_wait(&p->exclsem)
+# define nxterm_sempost(p) sem_post(&p->exclsem)
#endif
/* Common device registration */
-FAR struct nxcon_state_s *nxcon_register(NXTERM handle,
- FAR struct nxcon_window_s *wndo, FAR const struct nxcon_operations_s *ops,
+FAR struct nxterm_state_s *nxterm_register(NXTERM handle,
+ FAR struct nxterm_window_s *wndo, FAR const struct nxterm_operations_s *ops,
int minor);
#ifdef CONFIG_NXTERM_NXKBDIN
-ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len);
+ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len);
#ifndef CONFIG_DISABLE_POLL
-int nxcon_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
+int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
#endif
/* VT100 Terminal emulation */
-enum nxcon_vt100state_e nxcon_vt100(FAR struct nxcon_state_s *priv, char ch);
+enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv, char ch);
/* Generic text display helpers */
-void nxcon_home(FAR struct nxcon_state_s *priv);
-void nxcon_newline(FAR struct nxcon_state_s *priv);
-FAR const struct nxcon_bitmap_s *nxcon_addchar(NXHANDLE hfont,
- FAR struct nxcon_state_s *priv, uint8_t ch);
-int nxcon_hidechar(FAR struct nxcon_state_s *priv,
- FAR const struct nxcon_bitmap_s *bm);
-int nxcon_backspace(FAR struct nxcon_state_s *priv);
-void nxcon_fillchar(FAR struct nxcon_state_s *priv,
- FAR const struct nxgl_rect_s *rect, FAR const struct nxcon_bitmap_s *bm);
+void nxterm_home(FAR struct nxterm_state_s *priv);
+void nxterm_newline(FAR struct nxterm_state_s *priv);
+FAR const struct nxterm_bitmap_s *nxterm_addchar(NXHANDLE hfont,
+ FAR struct nxterm_state_s *priv, uint8_t ch);
+int nxterm_hidechar(FAR struct nxterm_state_s *priv,
+ FAR const struct nxterm_bitmap_s *bm);
+int nxterm_backspace(FAR struct nxterm_state_s *priv);
+void nxterm_fillchar(FAR struct nxterm_state_s *priv,
+ FAR const struct nxgl_rect_s *rect, FAR const struct nxterm_bitmap_s *bm);
-void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch);
-void nxcon_showcursor(FAR struct nxcon_state_s *priv);
-void nxcon_hidecursor(FAR struct nxcon_state_s *priv);
+void nxterm_putc(FAR struct nxterm_state_s *priv, uint8_t ch);
+void nxterm_showcursor(FAR struct nxterm_state_s *priv);
+void nxterm_hidecursor(FAR struct nxterm_state_s *priv);
/* Scrolling support */
-void nxcon_scroll(FAR struct nxcon_state_s *priv, int scrollheight);
+void nxterm_scroll(FAR struct nxterm_state_s *priv, int scrollheight);
-#endif /* __GRAPHICS_NXTERM_NXCON_INTERNAL_H */
+#endif /* __GRAPHICS_NXTERM_NXTERM_INTERNAL_H */
diff --git a/nuttx/graphics/nxterm/nxcon_driver.c b/nuttx/graphics/nxterm/nxterm_driver.c
index 5132183b2..77cb7b037 100644
--- a/nuttx/graphics/nxterm/nxcon_driver.c
+++ b/nuttx/graphics/nxterm/nxterm_driver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_driver.c
+ * nuttx/graphics/nxterm/nxterm_driver.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -49,14 +49,14 @@
#include <nuttx/fs/fs.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
-static int nxcon_open(FAR struct file *filep);
-static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
+static int nxterm_open(FAR struct file *filep);
+static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen);
/****************************************************************************
@@ -66,28 +66,28 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
#ifdef CONFIG_NXTERM_NXKBDIN
-const struct file_operations g_nxcon_drvrops =
+const struct file_operations g_nxterm_drvrops =
{
- nxcon_open, /* open */
+ nxterm_open, /* open */
0, /* close */
- nxcon_read, /* read */
- nxcon_write, /* write */
+ nxterm_read, /* read */
+ nxterm_write, /* write */
0, /* seek */
0 /* ioctl */
#ifndef CONFIG_DISABLE_POLL
,
- nxcon_poll /* poll */
+ nxterm_poll /* poll */
#endif
};
#else /* CONFIG_NXTERM_NXKBDIN */
-const struct file_operations g_nxcon_drvrops =
+const struct file_operations g_nxterm_drvrops =
{
- nxcon_open, /* open */
+ nxterm_open, /* open */
0, /* close */
0, /* read */
- nxcon_write, /* write */
+ nxterm_write, /* write */
0, /* seek */
0 /* ioctl */
#ifndef CONFIG_DISABLE_POLL
@@ -107,20 +107,20 @@ const struct file_operations g_nxcon_drvrops =
****************************************************************************/
/****************************************************************************
- * Name: nxcon_open
+ * Name: nxterm_open
****************************************************************************/
-static int nxcon_open(FAR struct file *filep)
+static int nxterm_open(FAR struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
- FAR struct nxcon_state_s *priv = inode->i_private;
+ FAR struct nxterm_state_s *priv = inode->i_private;
DEBUGASSERT(filep && filep->f_inode);
/* Get the driver structure from the inode */
inode = filep->f_inode;
- priv = (FAR struct nxcon_state_s *)inode->i_private;
+ priv = (FAR struct nxterm_state_s *)inode->i_private;
DEBUGASSERT(priv);
/* Verify that the driver is opened for write-only access */
@@ -140,14 +140,14 @@ static int nxcon_open(FAR struct file *filep)
}
/****************************************************************************
- * Name: nxcon_write
+ * Name: nxterm_write
****************************************************************************/
-static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
+static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen)
{
- FAR struct nxcon_state_s *priv;
- enum nxcon_vt100state_e state;
+ FAR struct nxterm_state_s *priv;
+ enum nxterm_vt100state_e state;
ssize_t remaining;
char ch;
int ret;
@@ -155,11 +155,11 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
/* Recover our private state structure */
DEBUGASSERT(filep && filep->f_priv);
- priv = (FAR struct nxcon_state_s *)filep->f_priv;
+ priv = (FAR struct nxterm_state_s *)filep->f_priv;
/* Get exclusive access */
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
if (ret < 0)
{
return ret;
@@ -167,7 +167,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
/* Hide the cursor while we update the display */
- nxcon_hidecursor(priv);
+ nxterm_hidecursor(priv);
/* Loop writing each character to the display */
@@ -183,7 +183,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
{
/* Is the character part of a VT100 escape sequnce? */
- state = nxcon_vt100(priv, ch);
+ state = nxterm_vt100(priv, ch);
switch (state)
{
/* Character is not part of a VT100 escape sequence (and no
@@ -195,7 +195,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
{
/* We can output the character to the window */
- nxcon_putc(priv, (uint8_t)ch);
+ nxterm_putc(priv, (uint8_t)ch);
}
break;
@@ -223,7 +223,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
/* Add the first unhandled character to the window */
- nxcon_putc(priv, (uint8_t)priv->seq[0]);
+ nxterm_putc(priv, (uint8_t)priv->seq[0]);
/* Move all buffer characters down one */
@@ -246,8 +246,8 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
/* Show the cursor at its new position */
- nxcon_showcursor(priv);
- nxcon_sempost(priv);
+ nxterm_showcursor(priv);
+ nxterm_sempost(priv);
return (ssize_t)buflen;
}
diff --git a/nuttx/graphics/nxterm/nxcon_font.c b/nuttx/graphics/nxterm/nxterm_font.c
index 310985ec4..dcbb8759b 100644
--- a/nuttx/graphics/nxterm/nxcon_font.c
+++ b/nuttx/graphics/nxterm/nxterm_font.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_font.c
+ * nuttx/graphics/nxterm/nxterm_font.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Definitions
@@ -95,27 +95,27 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_freeglyph
+ * Name: nxterm_freeglyph
****************************************************************************/
-static void nxcon_freeglyph(FAR struct nxcon_glyph_s *glyph)
+static void nxterm_freeglyph(FAR struct nxterm_glyph_s *glyph)
{
if (glyph->bitmap)
{
kmm_free(glyph->bitmap);
}
- memset(glyph, 0, sizeof(struct nxcon_glyph_s));
+ memset(glyph, 0, sizeof(struct nxterm_glyph_s));
}
/****************************************************************************
- * Name: nxcon_allocglyph
+ * Name: nxterm_allocglyph
****************************************************************************/
-static inline FAR struct nxcon_glyph_s *
-nxcon_allocglyph(FAR struct nxcon_state_s *priv)
+static inline FAR struct nxterm_glyph_s *
+nxterm_allocglyph(FAR struct nxterm_state_s *priv)
{
- FAR struct nxcon_glyph_s *glyph = NULL;
- FAR struct nxcon_glyph_s *luglyph = NULL;
+ FAR struct nxterm_glyph_s *glyph = NULL;
+ FAR struct nxterm_glyph_s *luglyph = NULL;
uint8_t luusecnt;
int i;
@@ -150,7 +150,7 @@ nxcon_allocglyph(FAR struct nxcon_state_s *priv)
*/
luusecnt = luglyph->usecnt;
- nxcon_freeglyph(luglyph);
+ nxterm_freeglyph(luglyph);
/* But lets decrement all of the usecnts so that the new one one be so
* far behind in the counts as the older ones.
@@ -179,11 +179,11 @@ nxcon_allocglyph(FAR struct nxcon_state_s *priv)
}
/****************************************************************************
- * Name: nxcon_findglyph
+ * Name: nxterm_findglyph
****************************************************************************/
-static FAR struct nxcon_glyph_s *
-nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
+static FAR struct nxterm_glyph_s *
+nxterm_findglyph(FAR struct nxterm_state_s *priv, uint8_t ch)
{
int i;
@@ -191,7 +191,7 @@ nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
for (i = 0; i < priv->maxglyphs; i++)
{
- FAR struct nxcon_glyph_s *glyph = &priv->glyph[i];
+ FAR struct nxterm_glyph_s *glyph = &priv->glyph[i];
if (glyph->usecnt > 0 && glyph->code == ch)
{
/* Increment the use count (unless it is already at the max) */
@@ -210,14 +210,14 @@ nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
}
/****************************************************************************
- * Name: nxcon_renderglyph
+ * Name: nxterm_renderglyph
****************************************************************************/
-static inline FAR struct nxcon_glyph_s *
-nxcon_renderglyph(FAR struct nxcon_state_s *priv,
+static inline FAR struct nxterm_glyph_s *
+nxterm_renderglyph(FAR struct nxterm_state_s *priv,
FAR const struct nx_fontbitmap_s *fbm, uint8_t ch)
{
- FAR struct nxcon_glyph_s *glyph = NULL;
+ FAR struct nxterm_glyph_s *glyph = NULL;
FAR nxgl_mxpixel_t *ptr;
#if CONFIG_NXTERM_BPP < 8
nxgl_mxpixel_t pixel;
@@ -229,7 +229,7 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
/* Allocate the glyph (always succeeds) */
- glyph = nxcon_allocglyph(priv);
+ glyph = nxterm_allocglyph(priv);
glyph->code = ch;
/* Get the dimensions of the glyph */
@@ -318,8 +318,8 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
{
/* Actually, the RENDERER never returns a failure */
- gdbg("nxcon_renderglyph: RENDERER failed\n");
- nxcon_freeglyph(glyph);
+ gdbg("nxterm_renderglyph: RENDERER failed\n");
+ nxterm_freeglyph(glyph);
glyph = NULL;
}
}
@@ -328,10 +328,10 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
}
/****************************************************************************
- * Name: nxcon_fontsize
+ * Name: nxterm_fontsize
****************************************************************************/
-static int nxcon_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *size)
+static int nxterm_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *size)
{
FAR const struct nx_fontbitmap_s *fbm;
@@ -351,18 +351,18 @@ static int nxcon_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *si
}
/****************************************************************************
- * Name: nxcon_getglyph
+ * Name: nxterm_getglyph
****************************************************************************/
-static FAR struct nxcon_glyph_s *
-nxcon_getglyph(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
+static FAR struct nxterm_glyph_s *
+nxterm_getglyph(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch)
{
- FAR struct nxcon_glyph_s *glyph;
+ FAR struct nxterm_glyph_s *glyph;
FAR const struct nx_fontbitmap_s *fbm;
/* First, try to find the glyph in the cache of pre-rendered glyphs */
- glyph = nxcon_findglyph(priv, ch);
+ glyph = nxterm_findglyph(priv, ch);
if (glyph)
{
/* We found it in the cache .. return the cached glyph */
@@ -377,7 +377,7 @@ nxcon_getglyph(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
{
/* Yes.. render the glyph */
- glyph = nxcon_renderglyph(priv, fbm, ch);
+ glyph = nxterm_renderglyph(priv, fbm, ch);
}
return glyph;
@@ -388,19 +388,19 @@ nxcon_getglyph(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
****************************************************************************/
/****************************************************************************
- * Name: nxcon_addchar
+ * Name: nxterm_addchar
*
* Description:
- * This is part of the nxcon_putc logic. It creates and positions a
+ * This is part of the nxterm_putc logic. It creates and positions a
* the character and renders (or re-uses) a glyph for font.
*
****************************************************************************/
-FAR const struct nxcon_bitmap_s *
-nxcon_addchar(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
+FAR const struct nxterm_bitmap_s *
+nxterm_addchar(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch)
{
- FAR struct nxcon_bitmap_s *bm = NULL;
- FAR struct nxcon_glyph_s *glyph;
+ FAR struct nxterm_bitmap_s *bm = NULL;
+ FAR struct nxterm_glyph_s *glyph;
/* Is there space for another character on the display? */
@@ -416,7 +416,7 @@ nxcon_addchar(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
/* Find (or create) the matching glyph */
- glyph = nxcon_getglyph(hfont, priv, ch);
+ glyph = nxterm_getglyph(hfont, priv, ch);
if (!glyph)
{
/* No, there is no font for this code. Just mark this as a space. */
@@ -443,25 +443,25 @@ nxcon_addchar(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
}
/****************************************************************************
- * Name: nxcon_hidechar
+ * Name: nxterm_hidechar
*
* Description:
* Erase a character from the window.
*
****************************************************************************/
-int nxcon_hidechar(FAR struct nxcon_state_s *priv,
- FAR const struct nxcon_bitmap_s *bm)
+int nxterm_hidechar(FAR struct nxterm_state_s *priv,
+ FAR const struct nxterm_bitmap_s *bm)
{
struct nxgl_rect_s bounds;
struct nxgl_size_s fsize;
int ret;
- /* Get the size of the font glyph. If nxcon_fontsize, then the
+ /* Get the size of the font glyph. If nxterm_fontsize, then the
* character will have been rendered as a space, and no display
* modification is required (not an error).
*/
- ret = nxcon_fontsize(priv->font, bm->code, &fsize);
+ ret = nxterm_fontsize(priv->font, bm->code, &fsize);
if (ret < 0)
{
/* It was rendered as a space. */
@@ -485,16 +485,16 @@ int nxcon_hidechar(FAR struct nxcon_state_s *priv,
}
/****************************************************************************
- * Name: nxcon_backspace
+ * Name: nxterm_backspace
*
* Description:
* Remove the last character from the window.
*
****************************************************************************/
-int nxcon_backspace(FAR struct nxcon_state_s *priv)
+int nxterm_backspace(FAR struct nxterm_state_s *priv)
{
- FAR struct nxcon_bitmap_s *bm;
+ FAR struct nxterm_bitmap_s *bm;
int ndx;
int ret = -ENOENT;
@@ -509,7 +509,7 @@ int nxcon_backspace(FAR struct nxcon_state_s *priv)
/* Erase the character from the display */
- ret = nxcon_hidechar(priv, bm);
+ ret = nxterm_hidechar(priv, bm);
/* The current position to the location where the last character was */
@@ -525,14 +525,14 @@ int nxcon_backspace(FAR struct nxcon_state_s *priv)
}
/****************************************************************************
- * Name: nxcon_home
+ * Name: nxterm_home
*
* Description:
* Set the next character position to the top-left corner of the display.
*
****************************************************************************/
-void nxcon_home(FAR struct nxcon_state_s *priv)
+void nxterm_home(FAR struct nxterm_state_s *priv)
{
/* The first character is one space from the left */
@@ -544,14 +544,14 @@ void nxcon_home(FAR struct nxcon_state_s *priv)
}
/****************************************************************************
- * Name: nxcon_newline
+ * Name: nxterm_newline
*
* Description:
* Set the next character position to the beginning of the next line.
*
****************************************************************************/
-void nxcon_newline(FAR struct nxcon_state_s *priv)
+void nxterm_newline(FAR struct nxterm_state_s *priv)
{
/* Carriage return: The first character is one space from the left */
@@ -563,19 +563,19 @@ void nxcon_newline(FAR struct nxcon_state_s *priv)
}
/****************************************************************************
- * Name: nxcon_fillchar
+ * Name: nxterm_fillchar
*
* Description:
- * This implements the character display. It is part of the nxcon_putc
+ * This implements the character display. It is part of the nxterm_putc
* operation but may also be used when redrawing an existing display.
*
****************************************************************************/
-void nxcon_fillchar(FAR struct nxcon_state_s *priv,
+void nxterm_fillchar(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
- FAR const struct nxcon_bitmap_s *bm)
+ FAR const struct nxterm_bitmap_s *bm)
{
- FAR struct nxcon_glyph_s *glyph;
+ FAR struct nxterm_glyph_s *glyph;
struct nxgl_rect_s bounds;
struct nxgl_rect_s intersection;
struct nxgl_size_s fsize;
@@ -590,7 +590,7 @@ void nxcon_fillchar(FAR struct nxcon_state_s *priv,
/* Get the size of the font glyph (which may not have been created yet) */
- ret = nxcon_fontsize(priv->font, bm->code, &fsize);
+ ret = nxterm_fontsize(priv->font, bm->code, &fsize);
if (ret < 0)
{
/* This would mean that there is no bitmap for the character code and
@@ -632,7 +632,7 @@ void nxcon_fillchar(FAR struct nxcon_state_s *priv,
/* Find (or create) the glyph that goes with this font */
- glyph = nxcon_getglyph(priv->font, priv, bm->code);
+ glyph = nxterm_getglyph(priv->font, priv, bm->code);
if (!glyph)
{
/* Shouldn't happen */
diff --git a/nuttx/graphics/nxterm/nxcon_kbdin.c b/nuttx/graphics/nxterm/nxterm_kbdin.c
index 4cac68edf..46c6e200b 100644
--- a/nuttx/graphics/nxterm/nxcon_kbdin.c
+++ b/nuttx/graphics/nxterm/nxterm_kbdin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_kbdin.c
+ * nuttx/graphics/nxterm/nxterm_kbdin.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <errno.h>
#include <debug.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
#ifdef CONFIG_NXTERM_NXKBDIN
@@ -67,11 +67,11 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_pollnotify
+ * Name: nxterm_pollnotify
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static void nxcon_pollnotify(FAR struct nxcon_state_s *priv, pollevent_t eventset)
+static void nxterm_pollnotify(FAR struct nxterm_state_s *priv, pollevent_t eventset)
{
FAR struct pollfd *fds;
irqstate_t flags;
@@ -95,7 +95,7 @@ static void nxcon_pollnotify(FAR struct nxcon_state_s *priv, pollevent_t eventse
}
}
#else
-# define nxcon_pollnotify(priv,event)
+# define nxterm_pollnotify(priv,event)
#endif
/****************************************************************************
@@ -103,16 +103,16 @@ static void nxcon_pollnotify(FAR struct nxcon_state_s *priv, pollevent_t eventse
****************************************************************************/
/****************************************************************************
- * Name: nxcon_read
+ * Name: nxterm_read
*
* Description:
* The optional NxTerm read method
*
****************************************************************************/
-ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
+ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
ssize_t nread;
char ch;
int ret;
@@ -120,14 +120,14 @@ ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
/* Recover our private state structure */
DEBUGASSERT(filep && filep->f_priv);
- priv = (FAR struct nxcon_state_s *)filep->f_priv;
+ priv = (FAR struct nxterm_state_s *)filep->f_priv;
/* Get exclusive access to the driver structure */
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
if (ret < 0)
{
- gdbg("ERROR: nxcon_semwait failed\n");
+ gdbg("ERROR: nxterm_semwait failed\n");
return ret;
}
@@ -159,13 +159,13 @@ ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
}
/* Otherwise, wait for something to be written to the circular
- * buffer. Increment the number of waiters so that the nxcon_write()
+ * buffer. Increment the number of waiters so that the nxterm_write()
* will not that it needs to post the semaphore to wake us up.
*/
sched_lock();
priv->nwaiters++;
- nxcon_sempost(priv);
+ nxterm_sempost(priv);
/* We may now be pre-empted! But that should be okay because we
* have already incremented nwaiters. Pre-emption is disabled
@@ -187,7 +187,7 @@ ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
/* Yes... then retake the mutual exclusion semaphore */
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
}
/* Was the semaphore wait successful? Did we successful re-take the
@@ -200,7 +200,7 @@ ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
int errval = errno;
- gdbg("ERROR: nxcon_semwait failed\n");
+ gdbg("ERROR: nxterm_semwait failed\n");
/* Were we awakened by a signal? Did we read anything before
* we received the signal?
@@ -245,7 +245,7 @@ ssize_t nxcon_read(FAR struct file *filep, FAR char *buffer, size_t len)
/* Relinquish the mutual exclusion semaphore */
- nxcon_sempost(priv);
+ nxterm_sempost(priv);
/* Notify all poll/select waiters that they can write to the FIFO */
@@ -254,7 +254,7 @@ errout_without_sem:
#ifndef CONFIG_DISABLE_POLL
if (nread > 0)
{
- nxcon_pollnotify(priv, POLLOUT);
+ nxterm_pollnotify(priv, POLLOUT);
}
#endif
@@ -264,14 +264,14 @@ errout_without_sem:
}
/****************************************************************************
- * Name: nxcon_poll
+ * Name: nxterm_poll
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-int nxcon_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
+int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
{
FAR struct inode *inode = filep->f_inode;
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
pollevent_t eventset;
int ret;
int i;
@@ -283,10 +283,10 @@ int nxcon_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
/* Get exclusive access to the driver structure */
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
if (ret < 0)
{
- gdbg("ERROR: nxcon_semwait failed\n");
+ gdbg("ERROR: nxterm_semwait failed\n");
return ret;
}
@@ -336,7 +336,7 @@ int nxcon_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
if (eventset)
{
- nxcon_pollnotify(priv, eventset);
+ nxterm_pollnotify(priv, eventset);
}
}
@@ -363,13 +363,13 @@ int nxcon_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
}
errout:
- nxcon_sempost(priv);
+ nxterm_sempost(priv);
return ret;
}
#endif
/****************************************************************************
- * Name: nxcon_kbdin
+ * Name: nxterm_kbdin
*
* Description:
* This function should be driven by the window kbdin callback function
@@ -394,9 +394,9 @@ errout:
*
****************************************************************************/
-void nxcon_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
+void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
{
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
ssize_t nwritten;
int nexthead;
char ch;
@@ -407,14 +407,14 @@ void nxcon_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
/* Get the reference to the driver structure from the handle */
- priv = (FAR struct nxcon_state_s *)handle;
+ priv = (FAR struct nxterm_state_s *)handle;
/* Get exclusive access to the driver structure */
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
if (ret < 0)
{
- gdbg("ERROR: nxcon_semwait failed\n");
+ gdbg("ERROR: nxterm_semwait failed\n");
return;
}
@@ -478,12 +478,12 @@ void nxcon_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
/* Notify all poll/select waiters that they can write to the FIFO */
#ifndef CONFIG_DISABLE_POLL
- nxcon_pollnotify(priv, POLLIN);
+ nxterm_pollnotify(priv, POLLIN);
#endif
sched_unlock();
}
- nxcon_sempost(priv);
+ nxterm_sempost(priv);
}
#endif /* CONFIG_NXTERM_NXKBDIN */
diff --git a/nuttx/graphics/nxterm/nxcon_putc.c b/nuttx/graphics/nxterm/nxterm_putc.c
index aa0c8f8a3..621f40664 100644
--- a/nuttx/graphics/nxterm/nxcon_putc.c
+++ b/nuttx/graphics/nxterm/nxterm_putc.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_putc.c
+ * nuttx/graphics/nxterm/nxterm_putc.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -41,7 +41,7 @@
#include <nuttx/ascii.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Definitions
@@ -68,16 +68,16 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_putc
+ * Name: nxterm_putc
*
* Description:
* Render the specified character at the current display position.
*
****************************************************************************/
-void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch)
+void nxterm_putc(FAR struct nxterm_state_s *priv, uint8_t ch)
{
- FAR const struct nxcon_bitmap_s *bm;
+ FAR const struct nxterm_bitmap_s *bm;
int lineheight;
/* Ignore carriage returns */
@@ -91,7 +91,7 @@ void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch)
if (ch == ASCII_BS || ch == ASCII_DEL)
{
- nxcon_backspace(priv);
+ nxterm_backspace(priv);
return;
}
@@ -102,7 +102,7 @@ void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch)
#ifndef CONFIG_NXTERM_NOWRAP
/* No.. move to the next line */
- nxcon_newline(priv);
+ nxterm_newline(priv);
/* If we were about to output a newline character, then don't */
@@ -126,7 +126,7 @@ void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch)
if (ch == '\n')
{
- nxcon_newline(priv);
+ nxterm_newline(priv);
return;
}
@@ -135,29 +135,29 @@ void nxcon_putc(FAR struct nxcon_state_s *priv, uint8_t ch)
lineheight = (priv->fheight + CONFIG_NXTERM_LINESEPARATION);
while (priv->fpos.y >= priv->wndo.wsize.h - lineheight)
{
- nxcon_scroll(priv, lineheight);
+ nxterm_scroll(priv, lineheight);
}
/* Find the glyph associated with the character and render it onto the
* display.
*/
- bm = nxcon_addchar(priv->font, priv, ch);
+ bm = nxterm_addchar(priv->font, priv, ch);
if (bm)
{
- nxcon_fillchar(priv, NULL, bm);
+ nxterm_fillchar(priv, NULL, bm);
}
}
/****************************************************************************
- * Name: nxcon_showcursor
+ * Name: nxterm_showcursor
*
* Description:
* Render the cursor character at the current display position.
*
****************************************************************************/
-void nxcon_showcursor(FAR struct nxcon_state_s *priv)
+void nxterm_showcursor(FAR struct nxterm_state_s *priv)
{
int lineheight;
@@ -168,7 +168,7 @@ void nxcon_showcursor(FAR struct nxcon_state_s *priv)
#ifndef CONFIG_NXTERM_NOWRAP
/* No.. move to the next line */
- nxcon_newline(priv);
+ nxterm_newline(priv);
#else
return;
#endif
@@ -179,25 +179,25 @@ void nxcon_showcursor(FAR struct nxcon_state_s *priv)
lineheight = (priv->fheight + CONFIG_NXTERM_LINESEPARATION);
while (priv->fpos.y >= priv->wndo.wsize.h - lineheight)
{
- nxcon_scroll(priv, lineheight);
+ nxterm_scroll(priv, lineheight);
}
/* Render the cursor glyph onto the display. */
priv->cursor.pos.x = priv->fpos.x;
priv->cursor.pos.y = priv->fpos.y;
- nxcon_fillchar(priv, NULL, &priv->cursor);
+ nxterm_fillchar(priv, NULL, &priv->cursor);
}
/****************************************************************************
- * Name: nxcon_hidecursor
+ * Name: nxterm_hidecursor
*
* Description:
* Render the cursor cursor character from the display.
*
****************************************************************************/
-void nxcon_hidecursor(FAR struct nxcon_state_s *priv)
+void nxterm_hidecursor(FAR struct nxterm_state_s *priv)
{
- (void)nxcon_hidechar(priv, &priv->cursor);
+ (void)nxterm_hidechar(priv, &priv->cursor);
}
diff --git a/nuttx/graphics/nxterm/nxcon_redraw.c b/nuttx/graphics/nxterm/nxterm_redraw.c
index 5ecb4ed48..71e18fcce 100644
--- a/nuttx/graphics/nxterm/nxcon_redraw.c
+++ b/nuttx/graphics/nxterm/nxterm_redraw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_bkgd.c
+ * nuttx/graphics/nxterm/nxterm_bkgd.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -49,7 +49,7 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxglib.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Definitions
@@ -80,7 +80,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_redraw
+ * Name: nxterm_redraw
*
* Description:
* Re-draw a portion of the NX console. This function should be called
@@ -98,9 +98,9 @@
*
****************************************************************************/
-void nxcon_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
+void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
{
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
int ret;
int i;
@@ -111,13 +111,13 @@ void nxcon_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
/* Recover our private state structure */
- priv = (FAR struct nxcon_state_s *)handle;
+ priv = (FAR struct nxterm_state_s *)handle;
/* Get exclusive access to the state structure */
do
{
- ret = nxcon_semwait(priv);
+ ret = nxterm_semwait(priv);
/* Check for errors */
@@ -146,8 +146,8 @@ void nxcon_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
for (i = 0; i < priv->nchars; i++)
{
- nxcon_fillchar(priv, rect, &priv->bm[i]);
+ nxterm_fillchar(priv, rect, &priv->bm[i]);
}
- (void)nxcon_sempost(priv);
+ (void)nxterm_sempost(priv);
}
diff --git a/nuttx/graphics/nxterm/nxcon_register.c b/nuttx/graphics/nxterm/nxterm_register.c
index c2ddca8f1..6a49e641c 100644
--- a/nuttx/graphics/nxterm/nxcon_register.c
+++ b/nuttx/graphics/nxterm/nxterm_register.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_register.c
+ * nuttx/graphics/nxterm/nxterm_register.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -50,7 +50,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Private Function Prototypes
@@ -69,14 +69,14 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_allocate
+ * Name: nxterm_allocate
****************************************************************************/
-FAR struct nxcon_state_s *
- nxcon_register(NXTERM handle, FAR struct nxcon_window_s *wndo,
- FAR const struct nxcon_operations_s *ops, int minor)
+FAR struct nxterm_state_s *
+ nxterm_register(NXTERM handle, FAR struct nxterm_window_s *wndo,
+ FAR const struct nxterm_operations_s *ops, int minor)
{
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
char devname[NX_DEVNAME_SIZE];
int ret;
@@ -84,7 +84,7 @@ FAR struct nxcon_state_s *
/* Allocate the driver structure */
- priv = (FAR struct nxcon_state_s *)kmm_zalloc(sizeof(struct nxcon_state_s));
+ priv = (FAR struct nxterm_state_s *)kmm_zalloc(sizeof(struct nxterm_state_s));
if (!priv)
{
gdbg("Failed to allocate the NX driver structure\n");
@@ -96,7 +96,7 @@ FAR struct nxcon_state_s *
priv->ops = ops;
priv->handle = handle;
priv->minor = minor;
- memcpy(&priv->wndo, wndo, sizeof( struct nxcon_window_s));
+ memcpy(&priv->wndo, wndo, sizeof( struct nxterm_window_s));
sem_init(&priv->exclsem, 0, 1);
#ifdef CONFIG_DEBUG
@@ -137,17 +137,17 @@ FAR struct nxcon_state_s *
/* Set the initial display position */
- nxcon_home(priv);
+ nxterm_home(priv);
/* Show the cursor */
priv->cursor.code = CONFIG_NXTERM_CURSORCHAR;
- nxcon_showcursor(priv);
+ nxterm_showcursor(priv);
/* Register the driver */
snprintf(devname, NX_DEVNAME_SIZE, NX_DEVNAME_FORMAT, minor);
- ret = register_driver(devname, &g_nxcon_drvrops, 0666, priv);
+ ret = register_driver(devname, &g_nxterm_drvrops, 0666, priv);
if (ret < 0)
{
gdbg("Failed to register %s\n", devname);
diff --git a/nuttx/graphics/nxterm/nxcon_scroll.c b/nuttx/graphics/nxterm/nxterm_scroll.c
index 508d26ec3..bb251ab1d 100644
--- a/nuttx/graphics/nxterm/nxcon_scroll.c
+++ b/nuttx/graphics/nxterm/nxterm_scroll.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_scroll.c
+ * nuttx/graphics/nxterm/nxterm_scroll.c
*
* Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,7 +51,7 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxfonts.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Definitions
@@ -78,7 +78,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_movedisplay
+ * Name: nxterm_movedisplay
*
* Description:
* This function implements the data movement for the scroll operation. If
@@ -88,17 +88,17 @@
****************************************************************************/
#ifdef CONFIG_NX_WRITEONLY
-static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
+static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
int bottom, int scrollheight)
{
- FAR struct nxcon_bitmap_s *bm;
+ FAR struct nxterm_bitmap_s *bm;
struct nxgl_rect_s rect;
nxgl_coord_t row;
int ret;
int i;
/* Move each row, one at a time. They could all be moved at once (by calling
- * nxcon_redraw), but the since the region is cleared, then re-written, the
+ * nxterm_redraw), but the since the region is cleared, then re-written, the
* effect would not be good. Below the region is also cleared and re-written,
* however, in much smaller chunks.
*/
@@ -128,7 +128,7 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
bm = &priv->bm[i];
if (bm->pos.y <= rect.pt2.y && bm->pos.y + priv->fheight >= rect.pt1.y)
{
- nxcon_fillchar(priv, &rect, bm);
+ nxterm_fillchar(priv, &rect, bm);
}
}
}
@@ -145,7 +145,7 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
}
}
#else
-static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
+static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
int bottom, int scrollheight)
{
struct nxgl_rect_s rect;
@@ -197,10 +197,10 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
****************************************************************************/
/****************************************************************************
- * Name: nxcon_scroll
+ * Name: nxterm_scroll
****************************************************************************/
-void nxcon_scroll(FAR struct nxcon_state_s *priv, int scrollheight)
+void nxterm_scroll(FAR struct nxterm_state_s *priv, int scrollheight)
{
int i;
int j;
@@ -209,7 +209,7 @@ void nxcon_scroll(FAR struct nxcon_state_s *priv, int scrollheight)
for (i = 0; i < priv->nchars; )
{
- FAR struct nxcon_bitmap_s *bm = &priv->bm[i];
+ FAR struct nxterm_bitmap_s *bm = &priv->bm[i];
/* Has any part of this character scrolled off the screen? */
@@ -219,7 +219,7 @@ void nxcon_scroll(FAR struct nxcon_state_s *priv, int scrollheight)
for (j = i; j < priv->nchars-1; j++)
{
- memcpy(&priv->bm[j], &priv->bm[j+1], sizeof(struct nxcon_bitmap_s));
+ memcpy(&priv->bm[j], &priv->bm[j+1], sizeof(struct nxterm_bitmap_s));
}
/* Decrement the number of cached characters ('i' is not incremented
@@ -249,5 +249,5 @@ void nxcon_scroll(FAR struct nxcon_state_s *priv, int scrollheight)
/* Move the display in the range of 0-height up one scrollheight. */
- nxcon_movedisplay(priv, priv->fpos.y, scrollheight);
+ nxterm_movedisplay(priv, priv->fpos.y, scrollheight);
}
diff --git a/nuttx/graphics/nxterm/nxcon_sem.c b/nuttx/graphics/nxterm/nxterm_sem.c
index 97d09c2b6..3bdbf8541 100644
--- a/nuttx/graphics/nxterm/nxcon_sem.c
+++ b/nuttx/graphics/nxterm/nxterm_sem.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_sem.c
+ * nuttx/graphics/nxterm/nxterm_sem.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <assert.h>
#include <errno.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
#ifdef CONFIG_DEBUG
@@ -69,7 +69,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_semwait and nxcon_sempost
+ * Name: nxterm_semwait and nxterm_sempost
*
* Description:
* If debug is on, then lower level code may attempt console output while
@@ -84,7 +84,7 @@
*
****************************************************************************/
-int nxcon_semwait(FAR struct nxcon_state_s *priv)
+int nxterm_semwait(FAR struct nxterm_state_s *priv)
{
pid_t me;
int ret;
@@ -112,7 +112,7 @@ int nxcon_semwait(FAR struct nxcon_state_s *priv)
return ERROR;
}
-int nxcon_sempost(FAR struct nxcon_state_s *priv)
+int nxterm_sempost(FAR struct nxterm_state_s *priv)
{
pid_t me = getpid();
diff --git a/nuttx/graphics/nxterm/nxcon_unregister.c b/nuttx/graphics/nxterm/nxterm_unregister.c
index a502eadd4..e51e44c17 100644
--- a/nuttx/graphics/nxterm/nxcon_unregister.c
+++ b/nuttx/graphics/nxterm/nxterm_unregister.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_unregister.c
+ * nuttx/graphics/nxterm/nxterm_unregister.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -48,7 +48,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/nx/nxterm.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Pre-processor Definitions
@@ -71,7 +71,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxcon_unregister
+ * Name: nxterm_unregister
*
* Description:
* Un-register to NX console device.
@@ -85,9 +85,9 @@
*
****************************************************************************/
-void nxcon_unregister(NXTERM handle)
+void nxterm_unregister(NXTERM handle)
{
- FAR struct nxcon_state_s *priv;
+ FAR struct nxterm_state_s *priv;
char devname[NX_DEVNAME_SIZE];
int i;
@@ -95,7 +95,7 @@ void nxcon_unregister(NXTERM handle)
/* Get the reference to the driver structure from the handle */
- priv = (FAR struct nxcon_state_s *)handle;
+ priv = (FAR struct nxterm_state_s *)handle;
sem_destroy(&priv->exclsem);
#ifdef CONFIG_NXTERM_NXKBDIN
sem_destroy(&priv->waitsem);
@@ -105,7 +105,7 @@ void nxcon_unregister(NXTERM handle)
for (i = 0; i < CONFIG_NXTERM_CACHESIZE; i++)
{
- FAR struct nxcon_glyph_s *glyph = &priv->glyph[i];
+ FAR struct nxterm_glyph_s *glyph = &priv->glyph[i];
if (glyph->bitmap)
{
kmm_free(glyph->bitmap);
diff --git a/nuttx/graphics/nxterm/nxcon_vt100.c b/nuttx/graphics/nxterm/nxterm_vt100.c
index cc8796341..17e3356ca 100644
--- a/nuttx/graphics/nxterm/nxcon_vt100.c
+++ b/nuttx/graphics/nxterm/nxterm_vt100.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/graphics/nxterm/nxcon_vt100.c
+ * nuttx/graphics/nxterm/nxterm_vt100.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <nuttx/vt100.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Pre-processor Definitions
@@ -54,7 +54,7 @@
* Private Types
****************************************************************************/
-typedef int (*seqhandler_t)(FAR struct nxcon_state_s *priv);
+typedef int (*seqhandler_t)(FAR struct nxterm_state_s *priv);
struct vt100_sequence_s
{
@@ -67,7 +67,7 @@ struct vt100_sequence_s
* Private Function Prototypes
****************************************************************************/
-static int nxcon_erasetoeol(FAR struct nxcon_state_s *priv);
+static int nxterm_erasetoeol(FAR struct nxterm_state_s *priv);
/****************************************************************************
* Private Data
@@ -85,7 +85,7 @@ static const char g_erasetoeol[] = VT100_CLEAREOL;
static const struct vt100_sequence_s g_vt100sequences[] =
{
- {g_erasetoeol, nxcon_erasetoeol, sizeof(g_erasetoeol)},
+ {g_erasetoeol, nxterm_erasetoeol, sizeof(g_erasetoeol)},
{NULL, NULL, 0}
};
@@ -94,7 +94,7 @@ static const struct vt100_sequence_s g_vt100sequences[] =
****************************************************************************/
/****************************************************************************
- * Name: nxcon_erasetoeol
+ * Name: nxterm_erasetoeol
*
* Description:
* Handle the erase-to-eol VT100 escapte sequence
@@ -107,7 +107,7 @@ static const struct vt100_sequence_s g_vt100sequences[] =
*
****************************************************************************/
-static int nxcon_erasetoeol(FAR struct nxcon_state_s *priv)
+static int nxterm_erasetoeol(FAR struct nxterm_state_s *priv)
{
/* Does nothing yet (other than consume the sequence) */
@@ -115,7 +115,7 @@ static int nxcon_erasetoeol(FAR struct nxcon_state_s *priv)
}
/****************************************************************************
- * Name: nxcon_vt100part
+ * Name: nxterm_vt100part
*
* Description:
* Return the next entry that is a partial match to the sequence.
@@ -131,7 +131,7 @@ static int nxcon_erasetoeol(FAR struct nxcon_state_s *priv)
****************************************************************************/
FAR const struct vt100_sequence_s *
-nxcon_vt100part(FAR struct nxcon_state_s *priv, int seqsize)
+nxterm_vt100part(FAR struct nxterm_state_s *priv, int seqsize)
{
FAR const struct vt100_sequence_s *seq;
int ndx;
@@ -159,7 +159,7 @@ nxcon_vt100part(FAR struct nxcon_state_s *priv, int seqsize)
}
/****************************************************************************
- * Name: nxcon_vt100seq
+ * Name: nxterm_vt100seq
*
* Description:
* Determine if the new sequence is a part of a supported VT100 escape
@@ -170,21 +170,21 @@ nxcon_vt100part(FAR struct nxcon_state_s *priv, int seqsize)
* seqsize - The number of bytes in the sequence
*
* Returned Value:
- * state - See enum nxcon_vt100state_e;
+ * state - See enum nxterm_vt100state_e;
*
****************************************************************************/
-static enum nxcon_vt100state_e nxcon_vt100seq(FAR struct nxcon_state_s *priv,
+static enum nxterm_vt100state_e nxterm_vt100seq(FAR struct nxterm_state_s *priv,
int seqsize)
{
FAR const struct vt100_sequence_s *seq;
- enum nxcon_vt100state_e ret;
+ enum nxterm_vt100state_e ret;
/* Is there any VT100 escape sequence that matches what we have
* buffered so far?
*/
- seq = nxcon_vt100part(priv, seqsize);
+ seq = nxterm_vt100part(priv, seqsize);
if (seq)
{
/* Yes.. if the size of that escape sequence is the same as what we
@@ -223,7 +223,7 @@ static enum nxcon_vt100state_e nxcon_vt100seq(FAR struct nxcon_state_s *priv,
****************************************************************************/
/****************************************************************************
- * Name: nxcon_vt100
+ * Name: nxterm_vt100
*
* Description:
* Test if the newly received byte is part of a VT100 escape sequence
@@ -233,13 +233,13 @@ static enum nxcon_vt100state_e nxcon_vt100seq(FAR struct nxcon_state_s *priv,
* ch - The newly received character
*
* Returned Value:
- * state - See enum nxcon_vt100state_e;
+ * state - See enum nxterm_vt100state_e;
*
****************************************************************************/
-enum nxcon_vt100state_e nxcon_vt100(FAR struct nxcon_state_s *priv, char ch)
+enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv, char ch)
{
- enum nxcon_vt100state_e ret;
+ enum nxterm_vt100state_e ret;
int seqsize;
DEBUGASSERT(priv && priv->nseq < VT100_MAX_SEQUENCE);
@@ -276,7 +276,7 @@ enum nxcon_vt100state_e nxcon_vt100(FAR struct nxcon_state_s *priv, char ch)
/* Then check if this sequence is part of an a valid escape sequence */
seqsize++;
- ret = nxcon_vt100seq(priv, seqsize);
+ ret = nxterm_vt100seq(priv, seqsize);
if (ret == VT100_CONSUMED)
{
/* The newly added character is indeed part of a VT100 escape sequence
diff --git a/nuttx/graphics/nxterm/nxtk_register.c b/nuttx/graphics/nxterm/nxtk_register.c
index df392961e..c66b56a06 100644
--- a/nuttx/graphics/nxterm/nxtk_register.c
+++ b/nuttx/graphics/nxterm/nxtk_register.c
@@ -42,7 +42,7 @@
#include <nuttx/nx/nxtk.h>
#include <nuttx/nx/nxterm.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Pre-processor Definitions
@@ -52,15 +52,15 @@
* Private Function Prototypes
****************************************************************************/
-static int nxtkcon_fill(FAR struct nxcon_state_s *priv,
+static int nxtkcon_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
#ifndef CONFIG_NX_WRITEONLY
-static int nxtkcon_move(FAR struct nxcon_state_s *priv,
+static int nxtkcon_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
#endif
-static int nxtkcon_bitmap(FAR struct nxcon_state_s *priv,
+static int nxtkcon_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -70,7 +70,7 @@ static int nxtkcon_bitmap(FAR struct nxcon_state_s *priv,
* Private Data
****************************************************************************/
-static const struct nxcon_operations_s g_nxtkops =
+static const struct nxterm_operations_s g_nxtkops =
{
nxtkcon_fill,
#ifndef CONFIG_NX_WRITEONLY
@@ -99,7 +99,7 @@ static const struct nxcon_operations_s g_nxtkops =
*
****************************************************************************/
-static int nxtkcon_fill(FAR struct nxcon_state_s *priv,
+static int nxtkcon_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES])
{
@@ -124,7 +124,7 @@ static int nxtkcon_fill(FAR struct nxcon_state_s *priv,
****************************************************************************/
#ifndef CONFIG_NX_WRITEONLY
-static int nxtkcon_move(FAR struct nxcon_state_s *priv,
+static int nxtkcon_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
{
@@ -155,7 +155,7 @@ static int nxtkcon_move(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-static int nxtkcon_bitmap(FAR struct nxcon_state_s *priv,
+static int nxtkcon_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -186,7 +186,7 @@ static int nxtkcon_bitmap(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-NXTERM nxtk_register(NXTKWINDOW hfwnd, FAR struct nxcon_window_s *wndo, int minor)
+NXTERM nxtk_register(NXTKWINDOW hfwnd, FAR struct nxterm_window_s *wndo, int minor)
{
- return nxcon_register((NXTERM)hfwnd, wndo, &g_nxtkops, minor);
+ return nxterm_register((NXTERM)hfwnd, wndo, &g_nxtkops, minor);
}
diff --git a/nuttx/graphics/nxterm/nxtool_register.c b/nuttx/graphics/nxterm/nxtool_register.c
index 631339a17..f1618bd5b 100644
--- a/nuttx/graphics/nxterm/nxtool_register.c
+++ b/nuttx/graphics/nxterm/nxtool_register.c
@@ -42,7 +42,7 @@
#include <nuttx/nx/nxtk.h>
#include <nuttx/nx/nxterm.h>
-#include "nxcon_internal.h"
+#include "nxterm.h"
/****************************************************************************
* Pre-processor Definitions
@@ -52,15 +52,15 @@
* Private Function Prototypes
****************************************************************************/
-static int nxtool_fill(FAR struct nxcon_state_s *priv,
+static int nxtool_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]);
#ifndef CONFIG_NX_WRITEONLY
-static int nxtool_move(FAR struct nxcon_state_s *priv,
+static int nxtool_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
#endif
-static int nxtool_bitmap(FAR struct nxcon_state_s *priv,
+static int nxtool_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -70,7 +70,7 @@ static int nxtool_bitmap(FAR struct nxcon_state_s *priv,
* Private Data
****************************************************************************/
-static const struct nxcon_operations_s g_nxtoolops =
+static const struct nxterm_operations_s g_nxtoolops =
{
nxtool_fill,
#ifndef CONFIG_NX_WRITEONLY
@@ -99,7 +99,7 @@ static const struct nxcon_operations_s g_nxtoolops =
*
****************************************************************************/
-static int nxtool_fill(FAR struct nxcon_state_s *priv,
+static int nxtool_fill(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES])
{
@@ -124,7 +124,7 @@ static int nxtool_fill(FAR struct nxcon_state_s *priv,
****************************************************************************/
#ifndef CONFIG_NX_WRITEONLY
-static int nxtool_move(FAR struct nxcon_state_s *priv,
+static int nxtool_move(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
{
@@ -155,7 +155,7 @@ static int nxtool_move(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-static int nxtool_bitmap(FAR struct nxcon_state_s *priv,
+static int nxtool_bitmap(FAR struct nxterm_state_s *priv,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
@@ -188,8 +188,8 @@ static int nxtool_bitmap(FAR struct nxcon_state_s *priv,
*
****************************************************************************/
-NXTERM nxtool_register(NXTKWINDOW hfwnd, FAR struct nxcon_window_s *wndo, int minor)
+NXTERM nxtool_register(NXTKWINDOW hfwnd, FAR struct nxterm_window_s *wndo, int minor)
{
- return nxcon_register((NXTERM)hfwnd, wndo, &g_nxtoolops, minor);
+ return nxterm_register((NXTERM)hfwnd, wndo, &g_nxtoolops, minor);
}
diff --git a/nuttx/include/nuttx/nx/nxterm.h b/nuttx/include/nuttx/nx/nxterm.h
index ed05f6d21..5be55d87c 100644
--- a/nuttx/include/nuttx/nx/nxterm.h
+++ b/nuttx/include/nuttx/nx/nxterm.h
@@ -100,7 +100,7 @@
* CONFIG_NXTERM_NXKBDIN
* Take input from the NX keyboard input callback. By default, keyboard
* input is taken from stdin (/dev/console). If this option is set, then
- * the interface nxcon_kbdin() is enabled. That interface may be driven
+ * the interface nxterm_kbdin() is enabled. That interface may be driven
* by window callback functions so that keyboard input *only* goes to the
* top window.
* CONFIG_NXTERM_KBDBUFSIZE
@@ -193,7 +193,7 @@ typedef FAR void *NXTERM;
/* This structure describes the window and font characteristics */
-struct nxcon_window_s
+struct nxterm_window_s
{
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES]; /* Window background color */
nxgl_mxpixel_t fcolor[CONFIG_NX_NPLANES]; /* Font color */
@@ -208,7 +208,8 @@ struct nxcon_window_s
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
# define EXTERN extern
#endif
@@ -222,7 +223,7 @@ extern "C" {
*
* Description:
* Register a console device on a raw NX window. The device will be
- * registered at /dev/nxconN where N is the provided minor number.
+ * registered at /dev/nxtermN where N is the provided minor number.
*
* Input Parameters:
* hwnd - A handle that will be used to access the window. The window must
@@ -237,15 +238,15 @@ extern "C" {
*
****************************************************************************/
-EXTERN NXTERM nx_register(NXWINDOW hwnd, FAR struct nxcon_window_s *wndo,
- int minor);
+NXTERM nx_register(NXWINDOW hwnd, FAR struct nxterm_window_s *wndo,
+ int minor);
/****************************************************************************
* Name: nxtk_register
*
* Description:
* Register a console device on a framed NX window. The device will be
- * registered at /dev/nxconN where N is the provided minor number.
+ * registered at /dev/nxtermN where N is the provided minor number.
*
* Input Parameters:
* hfwnd - A handle that will be used to access the window. The window must
@@ -260,15 +261,15 @@ EXTERN NXTERM nx_register(NXWINDOW hwnd, FAR struct nxcon_window_s *wndo,
*
****************************************************************************/
-EXTERN NXTERM nxtk_register(NXTKWINDOW hfwnd,
- FAR struct nxcon_window_s *wndo, int minor);
+NXTERM nxtk_register(NXTKWINDOW hfwnd, FAR struct nxterm_window_s *wndo,
+ int minor);
/****************************************************************************
* Name: nxtool_register
*
* Description:
* Register a console device on a toolbar of a framed NX window. The
- * device will be registered at /dev/nxconN where N is the provided minor
+ * device will be registered at /dev/nxtermN where N is the provided minor
* number.
*
* Input Parameters:
@@ -285,11 +286,11 @@ EXTERN NXTERM nxtk_register(NXTKWINDOW hfwnd,
*
****************************************************************************/
-EXTERN NXTERM nxtool_register(NXTKWINDOW hfwnd,
- FAR struct nxcon_window_s *wndo, int minor);
+NXTERM nxtool_register(NXTKWINDOW hfwnd, FAR struct nxterm_window_s *wndo,
+ int minor);
/****************************************************************************
- * Name: nxcon_unregister
+ * Name: nxterm_unregister
*
* Description:
* Un-register to NX console device.
@@ -303,10 +304,10 @@ EXTERN NXTERM nxtool_register(NXTKWINDOW hfwnd,
*
****************************************************************************/
-EXTERN void nxcon_unregister(NXTERM handle);
+void nxterm_unregister(NXTERM handle);
/****************************************************************************
- * Name: nxcon_redraw
+ * Name: nxterm_redraw
*
* Description:
* Re-draw a portion of the NX console. This function should be called
@@ -324,11 +325,11 @@ EXTERN void nxcon_unregister(NXTERM handle);
*
****************************************************************************/
-EXTERN void nxcon_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect,
- bool more);
+void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect,
+ bool more);
/****************************************************************************
- * Name: nxcon_kbdin
+ * Name: nxterm_kbdin
*
* Description:
* This function should be driven by the window kbdin callback function
@@ -354,8 +355,7 @@ EXTERN void nxcon_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect,
****************************************************************************/
#ifdef CONFIG_NXTERM_NXKBDIN
-EXTERN void nxcon_kbdin(NXTERM handle, FAR const uint8_t *buffer,
- uint8_t buflen);
+void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen);
#endif
#undef EXTERN