More NxWM support

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4682 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-05-01 20:36:19 +00:00
parent 3c07d3cb2b
commit 838d1f26dd
25 changed files with 1716 additions and 258 deletions

View File

@ -35,6 +35,9 @@ Installing and Building the Unit Tests
for the STM3210E-EVAL available. However, the unit test can be run on for the STM3210E-EVAL available. However, the unit test can be run on
other configurations (see steps d and e below). other configurations (see steps d and e below).
NOTE: The special configuratin sim/nxwm is recommended for unit-leveling
testing of NxWM because the configuration is more complex in that case.
We will assume the sim/nsh2 configuration in this discussion. The We will assume the sim/nsh2 configuration in this discussion. The
sim/nsh2 configuration is installed as follows: sim/nsh2 configuration is installed as follows:
@ -48,7 +51,7 @@ Installing and Building the Unit Tests
<nuttx-directory-path> is the full, absolute path to the NuttX build directory <nuttx-directory-path> is the full, absolute path to the NuttX build directory
If you are using the sim/nsh2 or stm3210e-eval configurations, then skip If you are using the sim/nsh2 or stm3210e-eval configurations, then skip
to step 2. to step 2 (Hmmm.. better check 1d) too).
There may be certain requirements for the configuration that you select... There may be certain requirements for the configuration that you select...
for example, certain widget tests may require touchscreen support or special for example, certain widget tests may require touchscreen support or special
@ -77,7 +80,12 @@ Installing and Building the Unit Tests
Then you can run the simulation using GDB or DDD which is a very powerful Then you can run the simulation using GDB or DDD which is a very powerful
debugging environment! debugging environment!
d) Other nuttx/.config changes -- NSH configurations only. d) Special configuration requirements for the nxwm unit test:
CONFIG_NXCONSOLE=y
CONFIG_NX_MULTIUSER=y
e) Other nuttx/.config changes -- NSH configurations only.
If the configuration that you are using supports NSH and NSH built-in tasks If the configuration that you are using supports NSH and NSH built-in tasks
then all is well. If it is an NSH configuration, then you will have to define then all is well. If it is an NSH configuration, then you will have to define
@ -89,7 +97,7 @@ Installing and Building the Unit Tests
to change anything further in the nuttx/.config file if you are using either to change anything further in the nuttx/.config file if you are using either
of these configurations. of these configurations.
e) Other apps/.config changes -- NON-NSH configurations only. f) Other apps/.config changes -- NON-NSH configurations only.
For non-NSH configurations (such as the sim/touchscreen) you will have to For non-NSH configurations (such as the sim/touchscreen) you will have to
remove the CONFIGURED_APPS seting that contains the user_start function so remove the CONFIGURED_APPS seting that contains the user_start function so
@ -147,7 +155,15 @@ Installing and Building the Unit Tests
cd <nxwidgets-directory>/libnxwidgets cd <nxwidgets-directory>/libnxwidgets
make TOPDIR=<nuttx-directory-path> make TOPDIR=<nuttx-directory-path>
6. Build NuttX including the unit test and the NXWidgets library 6. Build the NxWM library.
The NxWM library (libnxwm.a) is required only for the NxWM unit test at
NxWidgets/UnitTests/nxwm. For other unit tests, skip to step 7.
cd <nxwidgets-directory>/nxwm
make TOPDIR=<nuttx-directory-path>
7. Build NuttX including the unit test and the NXWidgets library
cd <nuttx-directory-path> cd <nuttx-directory-path>
. ./setenv.sh . ./setenv.sh
@ -268,6 +284,10 @@ CTextBox
Exercises the CTextBox widget Exercises the CTextBox widget
Depends on CLabel Depends on CLabel
nxwm
Exercises the NxWM window manager.
Use the special configuration nuttx/configs/sim/nxwm
Example Example
======= =======

View File

@ -54,12 +54,26 @@ else
CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"}
endif endif
# Add the path to the NxWM include directory to the CFLAGS
NXWM_DIR="$(TESTDIR)/../../nxwm"
NXWM_INC="$(NXWM_DIR)/include"
NXWM_LIB="$(NXWM_DIR)/libnxwm$(LIBEXT)"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWM_INC)"}
CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWM_INC)"}
else
CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWM_INC)"}
CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWM_INC)"}
endif
# Get the path to the archiver tool # Get the path to the archiver tool
TESTTOOL_DIR="$(TESTDIR)/../../tools" TESTTOOL_DIR="$(TESTDIR)/../../tools"
ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh
# Hello, World! C++ Example # NxWM unit test
ASRCS = ASRCS =
CSRCS = CSRCS =
@ -92,7 +106,7 @@ STACKSIZE = 2048
VPATH = VPATH =
all: .built all: .built
.PHONY: clean depend context disclean chkcxx chklib .PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm
# Object file creation targets # Object file creation targets
@ -121,7 +135,7 @@ endif
# Verify that the NXWidget library has been built # Verify that the NXWidget library has been built
chklib: chklibnxwidgets:
@( \ @( \
if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \
echo "$(NXWIDGETS_LIB) does not exist."; \ echo "$(NXWIDGETS_LIB) does not exist."; \
@ -131,18 +145,34 @@ chklib:
fi; \ fi; \
) )
# Verify that the NxWM library has been built
chklibnxwm:
@( \
if [ ! -e "$(NXWM_LIB)" ]; then \
echo "$(NXWM_LIB) does not exist."; \
echo "Please go to $(NXWM_LIB)"; \
echo "and rebuild the library"; \
exit 1; \
fi; \
)
# Library creation targets # Library creation targets
$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. $(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work.
.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work.
.built: chkcxx chklibnxwidgets chklibnxwm $(OBJS) $(NXWIDGETS_LIB)
@( for obj in $(OBJS) ; do \ @( for obj in $(OBJS) ; do \
$(call ARCHIVE, $(BIN), $${obj}); \ $(call ARCHIVE, $(BIN), $${obj}); \
done ; ) done ; )
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
@$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR)
@$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR)
else else
@$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR)
@$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR)
endif endif
@touch .built @touch .built

View File

@ -40,8 +40,12 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <cstdio>
#include <cstdlib>
#include "ctaskbar.hxx" #include "ctaskbar.hxx"
#include "cstartwindow.hxx" #include "cstartwindow.hxx"
#include "cnxconsole.hxx"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Pre-processor Definitions // Pre-processor Definitions
@ -61,7 +65,7 @@
// Private Types // Private Types
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
struct nxwm_test_s struct SNxWmTest
{ {
NxWM::CTaskbar *taskbar; // The task bar NxWM::CTaskbar *taskbar; // The task bar
NxWM::CStartWindow *startwindow; // The start window NxWM::CStartWindow *startwindow; // The start window
@ -71,7 +75,7 @@ struct nxwm_test_s
// Private Data // Private Data
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
static struct nxwm_test_s g_nxwmtest; static struct SNxWmTest g_nxwmtest;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Public Function Prototypes // Public Function Prototypes
@ -109,7 +113,7 @@ int MAIN_NAME(int argc, char *argv[])
// 4. Call CTaskBar::startWindowManager to start the display with applications in place // 4. Call CTaskBar::startWindowManager to start the display with applications in place
printf(MAIN_STRING "Create CTaskbar instance\n"); printf(MAIN_STRING "Create CTaskbar instance\n");
g_nxwmtest.taskbar = new CTaskbar(); g_nxwmtest.taskbar = new NxWM::CTaskbar();
if (!g_nxwmtest.taskbar) if (!g_nxwmtest.taskbar)
{ {
printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n");
@ -150,7 +154,7 @@ int MAIN_NAME(int argc, char *argv[])
// window application. // window application.
printf(MAIN_STRING "Opening the start window application window\n"); printf(MAIN_STRING "Opening the start window application window\n");
CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow();
if (!window) if (!window)
{ {
printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n");
@ -170,7 +174,8 @@ int MAIN_NAME(int argc, char *argv[])
// Add the NxConsole application to the start window // Add the NxConsole application to the start window
#if 0 NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint
printf(MAIN_STRING "Opening the NxConsole application window\n"); printf(MAIN_STRING "Opening the NxConsole application window\n");
window = g_nxwmtest.taskbar->openApplicationWindow(); window = g_nxwmtest.taskbar->openApplicationWindow();
if (!window) if (!window)
@ -180,7 +185,7 @@ int MAIN_NAME(int argc, char *argv[])
} }
printf(MAIN_STRING "Creating the NxConsole application\n"); printf(MAIN_STRING "Creating the NxConsole application\n");
NxWM::CNxConsole *console = new CNxConsole(window); console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window);
if (!console) if (!console)
{ {
printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n");
@ -196,11 +201,12 @@ int MAIN_NAME(int argc, char *argv[])
} }
noconsole: noconsole:
#endif
// Add the calculator application to the start window // Add the calculator application to the start window
#if 0 #if 0
NxWM::CCalculator *calculator = (NxWM::CCalculator *)0; // Avoid compiler complaint
printf(MAIN_STRING "Opening the calculator application window\n"); printf(MAIN_STRING "Opening the calculator application window\n");
window = g_nxwmtest.taskbar->openApplicationWindow(); window = g_nxwmtest.taskbar->openApplicationWindow();
if (!window) if (!window)
@ -210,7 +216,7 @@ noconsole:
} }
printf(MAIN_STRING "Creating the calculator application\n"); printf(MAIN_STRING "Creating the calculator application\n");
NxWM::CCalculator *calculator = new CCalculator(window); calculator = new NxWM::CCalculator(g_nxwmtest.taskbar, window);
if (!calculator) if (!calculator)
{ {
printf(MAIN_STRING "ERROR: Failed to instantiate calculator\n"); printf(MAIN_STRING "ERROR: Failed to instantiate calculator\n");

View File

@ -44,6 +44,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <semaphore.h>
#include <nuttx/nx/nx.h> #include <nuttx/nx/nx.h>
@ -79,21 +80,28 @@ namespace NXWidgets
class CNxServer class CNxServer
{ {
private: private:
#ifndef CONFIG_NX_MULTIUSER
FAR NX_DRIVERTYPE *m_hDevice; /**< LCD/Framebuffer device handle */ FAR NX_DRIVERTYPE *m_hDevice; /**< LCD/Framebuffer device handle */
#endif
NXHANDLE m_hNxServer; /**< NX server handle */ NXHANDLE m_hNxServer; /**< NX server handle */
#ifdef CONFIG_NX_MULTIUSER #ifdef CONFIG_NX_MULTIUSER
voilatile bool m_running; /**< True: The listener thread is running */ volatile bool m_running; /**< True: The listener thread is running */
voilatile bool m_connected; /**< True: Connected to the server */ volatile bool m_connected; /**< True: Connected to the server */
volatile bool m_stop; /**< True: Waiting for the listener thread to stop */ volatile bool m_stop; /**< True: Waiting for the listener thread to stop */
sem_t m_connsem; /**< Wait for server connection */ sem_t m_connsem; /**< Wait for server connection */
#endif #endif
static uint8_t m_nServers; /**< The number of NX server instances */ static uint8_t m_nServers; /**< The number of NX server instances */
/** /**
* This is the entry point of a thread that listeners for and dispatches * NX server thread. This is the entry point into the server thread that
* events from the NX server. * serializes the multi-threaded accesses to the display.
*/
#ifdef CONFIG_NX_MULTIUSER
static int server(int argc, char *argv[]);
#endif
/**
* NX listener thread. This is the entry point of a thread that listeners for and
* dispatches events from the NX server.
*/ */
#ifdef CONFIG_NX_MULTIUSER #ifdef CONFIG_NX_MULTIUSER

View File

@ -52,13 +52,20 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* NX Configuration *********************************************************/ /* NX Configuration *********************************************************/
/**
* C++ support is required
*/
#ifndef CONFIG_HAVE_CXX
# error "C++ support is required (CONFIG_HAVE_CXX)"
#endif
/** /**
* Required to enabled NX graphics support * Required to enabled NX graphics support
*/ */
#ifndef CONFIG_NX #ifndef CONFIG_NX
# error "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" # error "NX graphics support is required (CONFIG_NX)"
#endif #endif
/** /**
@ -112,7 +119,19 @@
*/ */
#ifndef CONFIG_NXWIDGETS_SERVERPRIO #ifndef CONFIG_NXWIDGETS_SERVERPRIO
# define CONFIG_NXWIDGETS_SERVERPRIO 50 # define CONFIG_NXWIDGETS_SERVERPRIO SCHED_PRIORITY_DEFAULT
#endif
#ifndef CONFIG_NXWIDGETS_CLIENTPRIO
# define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT
#endif
/**
* NX server thread stack size (in multi-user mode)
*/
#ifndef CONFIG_NXWIDGETS_SERVERSTACK
# define CONFIG_NXWIDGETS_SERVERSTACK 2048
#endif #endif
/** /**
@ -120,30 +139,35 @@
*/ */
#ifndef CONFIG_NXWIDGETS_LISTENERPRIO #ifndef CONFIG_NXWIDGETS_LISTENERPRIO
# define CONFIG_NXWIDGETS_LISTENERPRIO 50 # define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT
#endif #endif
/** /**
* NX server/listener thread stack size (in multi-user mode) * NX listener thread stack size (in multi-user mode)
*/ */
#ifndef CONFIG_NXWIDGETS_STACKSIZE #ifndef CONFIG_NXWIDGETS_LISTENERSTACK
# define CONFIG_NXWIDGETS_STACKSIZE 4096 # define CONFIG_NXWIDGETS_LISTENERSTACK 2048
#endif #endif
/* NXWidget Configuration ***************************************************/ /* NXWidget Configuration ***************************************************/
/* NX Server/Device Configuration /**
* NX Server/Device Configuration
* *
* CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than
* one LCDs connected. Default: 0 * one LCDs connected. Default: 0
* CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0
* CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode). * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode).
* Default: 50 * Default: 50
* CONFIG_NXWIDGETS_SERVERPRIO * CONFIG_NXWIDGETS_CLIENTPRIO
* CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in
* multi-user mode). Default: 50 * multi-user mode). Default: 50
* CONFIG_NXWIDGETS_STACKSIZE - Priority of the NX server/listener thread * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display
* stack size (in multi-user mode). Default: 4096 * initialization.
* CONFIG_NXWIDGETS_SERVERSTACK - NX server thread stack size (in multi-user
* mode). Default 2048
* CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user
* mode). Default 2048
* *
* NXWidget Configuration * NXWidget Configuration
* *

View File

@ -42,6 +42,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <unistd.h>
#include <cstdlib>
#include <cerrno> #include <cerrno>
#include <debug.h> #include <debug.h>
@ -212,12 +214,12 @@ bool CNxServer::connect(void)
// Start the server task // Start the server task
message("NxServer::connect: Starting nx_servertask task\n"); gvdbg("NxServer::connect: Starting server task\n");
serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO,
CONFIG_NXWIDGETS_STACKSIZE, nx_servertask, NULL); CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0);
if (serverId < 0) if (serverId < 0)
{ {
message("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno);
return false; return false;
} }
@ -239,7 +241,7 @@ bool CNxServer::connect(void)
(void)pthread_attr_init(&attr); (void)pthread_attr_init(&attr);
param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO;
(void)pthread_attr_setschedparam(&attr, &param); (void)pthread_attr_setschedparam(&attr, &param);
(void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_STACKSIZE); (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK);
m_stop = false; m_stop = false;
m_running = true; m_running = true;
@ -247,7 +249,7 @@ bool CNxServer::connect(void)
ret = pthread_create(&thread, &attr, listener, (FAR void *)this); ret = pthread_create(&thread, &attr, listener, (FAR void *)this);
if (ret != 0) if (ret != 0)
{ {
printf("NxServer::connect: pthread_create failed: %d\n", ret); gdbg("NxServer::connect: pthread_create failed: %d\n", ret);
m_running = false; m_running = false;
disconnect(); disconnect();
return false; return false;
@ -266,7 +268,7 @@ bool CNxServer::connect(void)
// In the successful case, the listener is still running (m_running) // In the successful case, the listener is still running (m_running)
// and the server is connected (m_connected). Anything else is a failure. // and the server is connected (m_connected). Anything else is a failure.
if (!m_connected !! !m_running) if (!m_connected || !m_running)
{ {
disconnect(); disconnect();
return false; return false;
@ -332,6 +334,75 @@ void CNxServer::disconnect(void)
} }
#endif #endif
/**
* NX server thread. This is the entry point into the server thread that
* serializes the multi-threaded accesses to the display.
*/
#ifdef CONFIG_NX_MULTIUSER
int CNxServer::server(int argc, char *argv[])
{
FAR NX_DRIVERTYPE *dev;
int ret;
#if defined(CONFIG_NXWIDGETS_EXTERNINIT)
/* Use external graphics driver initialization */
dev = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO);
if (!dev)
{
gdbg("up_nxdrvinit failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO);
return EXIT_FAILURE;
}
#elif defined(CONFIG_NX_LCDDRIVER)
/* Initialize the LCD device */
ret = up_lcdinitialize();
if (ret < 0)
{
gdbg("up_lcdinitialize failed: %d\n", -ret);
return EXIT_FAILURE;
}
/* Get the device instance */
dev = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO);
if (!dev)
{
gdbg("up_lcdgetdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO);
return EXIT_FAILURE;
}
/* Turn the LCD on at 75% power */
(void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4));
#else
/* Initialize the frame buffer device */
ret = up_fbinitialize();
if (ret < 0)
{
gdbg("nxcon_server: up_fbinitialize failed: %d\n", -ret);
return EXIT_FAILURE;
}
dev = up_fbgetvplane(CONFIG_NXWIDGETS_VPLANE);
if (!dev)
{
gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE);
return 2;
}
#endif
/* Then start the server */
ret = nx_run(dev);
gvdbg("nx_run returned: %d\n", errno);
return EXIT_FAILURE;
}
#endif
/** /**
* This is the entry point of a thread that listeners for and dispatches * This is the entry point of a thread that listeners for and dispatches
* events from the NX server. * events from the NX server.
@ -342,7 +413,7 @@ FAR void *CNxServer::listener(FAR void *arg)
{ {
// The argument must be the CNxServer instance // The argument must be the CNxServer instance
CNxServer *This = (CNxServer*)pvArg; CNxServer *This = (CNxServer*)arg;
// Process events forever // Process events forever
@ -361,7 +432,7 @@ FAR void *CNxServer::listener(FAR void *arg)
// An error occurred... assume that we have lost connection with // An error occurred... assume that we have lost connection with
// the server. // the server.
gdbg("CNxServer::listener: Lost server connection: %d\n", errno); gdbg("Lost server connection: %d\n", errno);
break; break;
} }
@ -371,7 +442,7 @@ FAR void *CNxServer::listener(FAR void *arg)
{ {
This->m_connected = true; This->m_connected = true;
sem_post(&This->m_connsem); sem_post(&This->m_connsem);
gdbg("CNxServer::listener: Connected\n"); gvdbg("Connected\n");
} }
} }

View File

@ -165,7 +165,27 @@ namespace NxWM
{ {
m_callback = callback; m_callback = callback;
} }
};
/**
* Simulate a mouse click on the minimize icon. This inline method is only
* used during automated testing of NxWM.
*/
inline void clickMinimizeIcon(int index)
{
m_minimizeImage->click(0,0);
}
/**
* Simulate a mouse click on the stop applicaiton icon. This inline method is only
* used during automated testing of NxWM.
*/
inline void clickStopIcon(int index)
{
m_stopImage->click(0,0);
}
};
} }
#endif // __cplusplus #endif // __cplusplus

View File

@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_CNXCONSOLE_NXX #ifndef __INCLUDE_CNXCONSOLE_HXX
#define __INCLUDE_CNXCONSOLE_NXX #define __INCLUDE_CNXCONSOLE_HXX
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@ -77,12 +77,19 @@ namespace NxWM
class CNxConsole : public IApplication, private IApplicationCallback class CNxConsole : public IApplication, private IApplicationCallback
{ {
protected: private:
CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
CApplicationWindow *m_window; /**< Reference to the application window */ CApplicationWindow *m_window; /**< Reference to the application window */
NXCONSOLE m_nxcon; /**< NxConsole handle */ NXCONSOLE m_nxcon; /**< NxConsole handle */
pid_t m_pid; /**< Task ID of the NxConsole thread */ pid_t m_pid; /**< Task ID of the NxConsole thread */
/**
* This is the NxConsole task. This function first redirects output to the
* console window.
*/
static int nxconsole(int argc, char *argv[]);
/** /**
* Called when the window minimize button is pressed. * Called when the window minimize button is pressed.
*/ */
@ -170,4 +177,4 @@ namespace NxWM
} }
#endif // __cplusplus #endif // __cplusplus
#endif // __INCLUDE_CNXCONSOLE_NXX #endif // __INCLUDE_CNXCONSOLE_HXX

View File

@ -116,12 +116,6 @@ namespace NxWM
void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); void handleClickEvent(const NXWidgets::CWidgetEventArgs &e);
/**
* CStartWindow Constructor
*/
~CStartWindow(void);
public: public:
/** /**
@ -133,6 +127,12 @@ namespace NxWM
CStartWindow(CTaskbar *taskbar, CApplicationWindow *window); CStartWindow(CTaskbar *taskbar, CApplicationWindow *window);
/**
* CStartWindow Constructor
*/
~CStartWindow(void);
/** /**
* Each implementation of IApplication must provide a method to recover * Each implementation of IApplication must provide a method to recover
* the contained CApplicationWindow instance. * the contained CApplicationWindow instance.
@ -185,7 +185,7 @@ namespace NxWM
* CTaskbar when the application window must be displayed * CTaskbar when the application window must be displayed
*/ */
virtual void redraw(void) = 0; void redraw(void);
/** /**
* Add the application to the start window. The general sequence for * Add the application to the start window. The general sequence for
@ -203,6 +203,19 @@ namespace NxWM
*/ */
bool addApplication(IApplication *app); bool addApplication(IApplication *app);
/**
* Simulate a mouse click on the icon at index. This inline method is only
* used during automated testing of NxWM.
*/
inline void clickIcon(int index)
{
if (index < m_slots.size())
{
m_slots.at(index).image->click(0,0);
}
}
}; };
} }

View File

@ -100,18 +100,6 @@ namespace NxWM
IApplication *m_topapp; /**< The top application in the hierarchy */ IApplication *m_topapp; /**< The top application in the hierarchy */
TNxArray<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */ TNxArray<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */
/**
* Connect to the server
*/
bool connect(void);
/**
* Disconnect from the server
*/
void disconnect(void);
/** /**
* Create a raw window. * Create a raw window.
* *
@ -202,12 +190,6 @@ namespace NxWM
void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); void handleClickEvent(const NXWidgets::CWidgetEventArgs &e);
/**
* CTaskbar Destructor
*/
~CTaskbar(void);
public: public:
/** /**
* CTaskbar Constructor * CTaskbar Constructor
@ -217,6 +199,24 @@ namespace NxWM
CTaskbar(void); CTaskbar(void);
/**
* CTaskbar Destructor
*/
~CTaskbar(void);
/**
* Connect to the server
*/
bool connect(void);
/**
* Disconnect from the server
*/
void disconnect(void);
/** /**
* Initialize task bar. Task bar initialization is separate from * Initialize task bar. Task bar initialization is separate from
* object instantiation so that failures can be reported. The window * object instantiation so that failures can be reported. The window
@ -341,6 +341,19 @@ namespace NxWM
*/ */
bool stopApplication(IApplication *app); bool stopApplication(IApplication *app);
/**
* Simulate a mouse click on the icon at index. This inline method is only
* used duringautomated testing of NxWM.
*/
inline void clickIcon(int index)
{
if (index < m_slots.size())
{
m_slots.at(index).image->click(0,0);
}
}
}; };
} }

View File

@ -49,12 +49,42 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* General Configuration ****************************************************/ /* General Configuration ****************************************************/
/**
* Required settings:
*
* CONFIG_HAVE_CXX : C++ support is required
* CONFIG_NX : NX must enabled
* CONFIG_NX_MULTIUSER=y : NX must be configured in multiuse mode
* CONFIG_NXCONSOLE=y : For NxConsole support
*
* General settings:
*
* CONFIG_NXWM_DEFAULT_FONTID - the NxWM default font ID. Default:
* NXFONT_DEFAULT
*/
#ifndef CONFIG_HAVE_CXX
# error "C++ support is required (CONFIG_HAVE_CXX)"
#endif
/** /**
* NX Multi-user support is required * NX Multi-user support is required
*/ */
#ifndef CONFIG_NX
# error "NX support is required (CONFIG_NX)"
#endif
#ifndef CONFIG_NX_MULTIUSER #ifndef CONFIG_NX_MULTIUSER
# warning "NX multi-user support is required (CONFIG_NX_MULTIUSER)" # error "NX multi-user support is required (CONFIG_NX_MULTIUSER)"
#endif
/**
* NxConsole support is (probably) required
*/
#ifndef CONFIG_NXCONSOLE
# warning "NxConsole support may be needed (CONFIG_NXCONSOLE)"
#endif #endif
/** /**
@ -66,6 +96,27 @@
#endif #endif
/* Colors *******************************************************************/ /* Colors *******************************************************************/
/**
* Color configuration
*
* CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default:
* MKRGB(160,160,160)
* CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR - Select background color.
* Default: MKRGB(120,192,192)
* CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR - Normal "foreground" color. Default:
* MKRGB(192,192,192)
* CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR - Selected "foreground" color.
* Default: MKRGB(192,192,192)
* CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR - Color of the bright edge of a border.
* Default: MKRGB(255,255,255)
* CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR - Color of the shadowed edge of a border.
* Default: MKRGB(0,0,0)
* CONFIG_NXWM_DEFAULT_FONTCOLOR - Default fong color. Default:
* MKRGB(0,0,0)
* CONFIG_NXWM_TRANSPARENT_COLOR - The "transparent" color. Default:
* MKRGB(0,0,0)
*/
/** /**
* Normal background color * Normal background color
*/ */
@ -127,6 +178,23 @@
#endif #endif
/* Task Bar Configuation ***************************************************/ /* Task Bar Configuation ***************************************************/
/**
* Horizontal and vertical spacing of icons in the task bar.
*
* CONFIG_NXWM_TASKBAR_VSPACING - Vertical spacing. Default: 2 pixels
* CONFIG_NXWM_TASKBAR_HSPACING - Horizontal spacing. Default: 2 rows
*
* Task bar location. Default is CONFIG_NXWM_TASKBAR_TOP.
*
* CONFIG_NXWM_TASKBAR_TOP - Task bar is at the top of the display
* CONFIG_NXWM_TASKBAR_BOTTOM - Task bar is at the bottom of the display
* CONFIG_NXWM_TASKBAR_LEFT - Task bar is on the left side of the display
* CONFIG_NXWM_TASKBAR_RIGHT - Task bar is on the right side of the display
*
* CONFIG_NXWM_TASKBAR_WIDTH - Task bar thickness (either vertical or
* horizontal). Default: 25 + 2*spacing
*/
/** /**
* Horizontal and vertical spacing of icons in the task bar. * Horizontal and vertical spacing of icons in the task bar.
*/ */
@ -152,7 +220,7 @@
# warning "Multiple task bar positions specified" # warning "Multiple task bar positions specified"
# endif # endif
#elif defined(CONFIG_NXWM_TASKBAR_LEFT) #elif defined(CONFIG_NXWM_TASKBAR_LEFT)
# if defined defined (CONFIG_NXWM_TASKBAR_RIGHT) # if defined (CONFIG_NXWM_TASKBAR_RIGHT)
# warning "Multiple task bar positions specified" # warning "Multiple task bar positions specified"
# endif # endif
#elif !defined(CONFIG_NXWM_TASKBAR_RIGHT) #elif !defined(CONFIG_NXWM_TASKBAR_RIGHT)
@ -174,12 +242,20 @@
#endif #endif
/* Tool Bar Configuration ***************************************************/ /* Tool Bar Configuration ***************************************************/
/**
* CONFIG_NXWM_TOOLBAR_HEIGHT. The height of the tool bar in each
* application window. Default: Same as the thickness of the task bar.
*/
#ifndef CONFIG_NXWM_TOOLBAR_HEIGHT #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT
# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH # define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH
#endif #endif
/* Background Image **********************************************************/ /* Background Image **********************************************************/
/**
* CONFIG_NXWM_BACKGROUND_IMAGE - The name of the image to use in the
* background window. Default:NXWidgets::g_nuttxBitmap
*/
#ifndef CONFIG_NXWM_BACKGROUND_IMAGE #ifndef CONFIG_NXWM_BACKGROUND_IMAGE
# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap # define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap
@ -188,6 +264,9 @@
/* Start Window Configuration ***********************************************/ /* Start Window Configuration ***********************************************/
/** /**
* Horizontal and vertical spacing of icons in the task bar. * Horizontal and vertical spacing of icons in the task bar.
*
* CONFIG_NXWM_STARTWINDOW_VSPACING - Vertical spacing. Default: 2 pixels
* CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows
*/ */
#ifndef CONFIG_NXWM_STARTWINDOW_VSPACING #ifndef CONFIG_NXWM_STARTWINDOW_VSPACING
@ -199,6 +278,20 @@
#endif #endif
/* NxConsole Window *********************************************************/ /* NxConsole Window *********************************************************/
/**
* NxConsole Window Configuration
*
* CONFIG_NXWM_NXCONSOLE_PRIO - Priority of the NxConsole task. Default:
* SCHED_PRIORITY_DEFAULT
* CONFIG_NXWM_NXCONSOLE_STACKSIZE - The stack size to use when starting the
* NxConsole task. Default: 2048 bytes.
* CONFIG_NXWM_NXCONSOLE_WCOLOR - The color of the NxConsole window background.
* Default: MKRGB(192,192,192)
* CONFIG_NXWM_NXCONSOLE_FONTCOLOR - The color of the fonts to use in the
* NxConsole window. Default: MKRGB(0,0,0)
* CONFIG_NXWM_NXCONSOLE_FONTID - The ID of the font to use in the NxConsole
* window. Default: CONFIG_NXWM_DEFAULT_FONTID
*/
#ifndef CONFIG_NXWM_NXCONSOLE_PRIO #ifndef CONFIG_NXWM_NXCONSOLE_PRIO
# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT # define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT

View File

@ -41,9 +41,9 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cunistd>
#include <ctime> #include <ctime>
#include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <semaphore.h> #include <semaphore.h>
#include <sched.h> #include <sched.h>
@ -53,8 +53,8 @@
#include "cwidgetcontrol.hxx" #include "cwidgetcontrol.hxx"
#include "nxwmconfig.hxx" #include "nxwmconfig.hxx"
#include "cnxconsole.hxx"
#include "nxwmglyphs.hxx" #include "nxwmglyphs.hxx"
#include "cnxconsole.hxx"
/******************************************************************************************** /********************************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
@ -66,119 +66,36 @@
namespace NxWM namespace NxWM
{ {
/** /**
* This structure is used to pass start up parameters to nxcon_task and to assure the * This structure is used to pass start up parameters to the NxConsole task and to assure the
* the NxConsole is successfully started. * the NxConsole is successfully started.
*/ */
struct nxcon_task_s struct SNxConsole
{ {
sem_t sem; // Sem that will be posted when the task is successfully initialized sem_t sem; /**< Sem that will be posted when the task is successfully initialized */
NXTKWINDOW hwnd; // Window handle NXTKWINDOW hwnd; /**< Window handle */
NXCONSOLE nxcon; // NxConsole handle NXCONSOLE nxcon; /**< NxConsole handle */
int minor; // Next device minor number int minor; /**< Next device minor number */
bool result; // True if successfully initialized bool result; /**< True if successfully initialized */
}; };
/******************************************************************************************** /********************************************************************************************
* Private Data * Private Data
********************************************************************************************/ ********************************************************************************************/
/** /**
* This global data structure is used to pass start parameters to nxcon_task and to * This global data structure is used to pass start parameters to NxConsole task and to
* assure that the NxConsole is successfully started. * assure that the NxConsole is successfully started.
*/ */
static struct nxcon_task_s g_nxconvars; static struct SNxConsole g_nxconvars;
}
/******************************************************************************************** /********************************************************************************************
* Private Functions * Private Functions
********************************************************************************************/ ********************************************************************************************/
/**
* This is the NxConsole task. This function first redirects output to the console window.
*/
static int nxcon_task(int argc, char *argv[])
{
// Configure NxConsole
struct nxcon_window_s wndo; /* Describes the window */
wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR;
wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR;
wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID;
// To stop compiler complaining about "jump to label crosses initialization of 'int fd'
int fd = -1;
// Use the window handle to create the NX console
g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor);
if (!g_nxconvars.nxcon)
{
goto errout;
}
// Construct the driver name using this minor number
char devname[32];
snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor);
// Increment the minor number while it is protect by the semaphore
g_nxconvars.minor++;
// Open the NxConsole driver
fd = open(devname, O_WRONLY);
if (fd < 0)
{
goto errout_with_nxcon;
}
// Now re-direct stdout and stderr so that they use the NX console driver.
// Note that stdin is retained (file descriptor 0, probably the the serial console).
(void)fflush(stdout);
(void)fflush(stderr);
(void)fclose(stdout);
(void)fclose(stderr);
(void)dup2(fd, 1);
(void)dup2(fd, 2);
// And we can close our original driver file descriptor
close(fd);
// Inform the parent thread that we successfully initialize
g_nxconvars.result = true;
sem_post(&g_nxconvars.sem);
// Run the NSH console
#ifdef CONFIG_NSH_CONSOLE
(void)nsh_consolemain(argc, argv);
#endif
// We get here if console exits
#warning "Missing logic"
return EXIT_SUCCESS;
errout_with_nxcon:
nxcon_unregister(g_nxconvars.nxcon);
errout:
g_nxconvars.nxcon = 0;
g_nxconvars.result = false;
sem_post(&g_nxconvars.sem);
return EXIT_FAILURE;
}
}
/******************************************************************************************** /********************************************************************************************
* CNxConsole Method Implementations * CNxConsole Method Implementations
********************************************************************************************/ ********************************************************************************************/
@ -328,7 +245,7 @@ bool CNxConsole::run(void)
sched_lock(); sched_lock();
m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO,
CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxcon_task, CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxconsole,
(FAR const char **)0); (FAR const char **)0);
// Did we successfully start the NxConsole task? // Did we successfully start the NxConsole task?
@ -423,6 +340,90 @@ void CNxConsole::redraw(void)
nxcon_redraw(m_nxcon, &rect, false); nxcon_redraw(m_nxcon, &rect, false);
} }
/**
* This is the NxConsole task. This function first redirects output to the
* console window.
*/
int CNxConsole::nxconsole(int argc, char *argv[])
{
// Configure NxConsole
struct nxcon_window_s wndo; /* Describes the window */
wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR;
wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR;
wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID;
// To stop compiler complaining about "jump to label crosses initialization of 'int fd'
int fd = -1;
// Use the window handle to create the NX console
g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor);
if (!g_nxconvars.nxcon)
{
goto errout;
}
// Construct the driver name using this minor number
char devname[32];
snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor);
// Increment the minor number while it is protect by the semaphore
g_nxconvars.minor++;
// Open the NxConsole driver
fd = open(devname, O_WRONLY);
if (fd < 0)
{
goto errout_with_nxcon;
}
// Now re-direct stdout and stderr so that they use the NX console driver.
// Note that stdin is retained (file descriptor 0, probably the the serial console).
(void)std::fflush(stdout);
(void)std::fflush(stderr);
(void)std::fclose(stdout);
(void)std::fclose(stderr);
(void)std::dup2(fd, 1);
(void)std::dup2(fd, 2);
// And we can close our original driver file descriptor
std::close(fd);
// Inform the parent thread that we successfully initialize
g_nxconvars.result = true;
sem_post(&g_nxconvars.sem);
// Run the NSH console
#ifdef CONFIG_NSH_CONSOLE
(void)nsh_consolemain(argc, argv);
#endif
// We get here if console exits
#warning "Missing logic"
return EXIT_SUCCESS;
errout_with_nxcon:
nxcon_unregister(g_nxconvars.nxcon);
errout:
g_nxconvars.nxcon = 0;
g_nxconvars.result = false;
sem_post(&g_nxconvars.sem);
return EXIT_FAILURE;
}
/** /**
* Called when the window minimize button is pressed. * Called when the window minimize button is pressed.
*/ */

View File

@ -82,6 +82,84 @@ CTaskbar::~CTaskbar(void)
disconnect(); disconnect();
} }
/**
* Connect to the server
*/
bool CTaskbar::connect(void)
{
// Connect to the server
bool nxConnected = CNxServer::connect();
if (nxConnected)
{
// Set the background color
if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR))
{
// Failed
}
}
return nxConnected;
}
/**
* Disconnect from the server
*/
void CTaskbar::disconnect(void)
{
// Stop all applications and remove them from the task bar. Clearly, there
// are some ordering issues here... On an orderly system shutdown, disconnection
// should really occur priority to deleting instances
while (!m_slots.empty())
{
IApplication *app = m_slots.at(0).app;
stopApplication(app);
}
// Close the windows
NXWidgets::CWidgetControl *control;
if (m_taskbar)
{
// Delete the contained widget control. We are responsible for it
// because we created it
control = m_taskbar->getWidgetControl();
if (control)
{
delete control;
}
// Then delete the task bar window
delete m_taskbar;
}
if (m_background)
{
// Delete the contained widget control. We are responsible for it
// because we created it
control = m_background->getWidgetControl();
if (control)
{
delete control;
}
// Then delete the background
delete m_background;
}
// And disconnect from the server
CNxServer::disconnect();
}
/** /**
* Initialize task bar. Task bar initialization is separate from * Initialize task bar. Task bar initialization is separate from
* object instantiation so that failures can be reported. The window * object instantiation so that failures can be reported. The window
@ -426,84 +504,6 @@ bool CTaskbar::stopApplication(IApplication *app)
return redrawTaskbarWindow(); return redrawTaskbarWindow();
} }
/**
* Connect to the server
*/
bool CTaskbar::connect(void)
{
// Connect to the server
bool nxConnected = CNxServer::connect();
if (nxConnected)
{
// Set the background color
if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR))
{
// Failed
}
}
return nxConnected;
}
/**
* Disconnect from the server
*/
void CTaskbar::disconnect(void)
{
// Stop all applications and remove them from the task bar. Clearly, there
// are some ordering issues here... On an orderly system shutdown, disconnection
// should really occur priority to deleting instances
while (!m_slots.empty())
{
IApplication *app = m_slots.at(0).app;
stopApplication(app);
}
// Close the windows
NXWidgets::CWidgetControl *control;
if (m_taskbar)
{
// Delete the contained widget control. We are responsible for it
// because we created it
control = m_taskbar->getWidgetControl();
if (control)
{
delete control;
}
// Then delete the task bar window
delete m_taskbar;
}
if (m_background)
{
// Delete the contained widget control. We are responsible for it
// because we created it
control = m_background->getWidgetControl();
if (control)
{
delete control;
}
// Then delete the background
delete m_background;
}
// And disconnect from the server
CNxServer::disconnect();
}
/** /**
* Create a raw window. * Create a raw window.
* *
@ -893,7 +893,7 @@ bool CTaskbar::redrawTaskbarWindow(void)
// For vertical task bars, the icons will be centered horizontally // For vertical task bars, the icons will be centered horizontally
iconPos.x = (windowSize.w - rect.getWidth()) >> 1; iconPos.x = (windowSize.w - rect.getWidth()) >> 1;
iconPos.y = taskbarPos.y iconPos.y = taskbarPos.y;
#endif #endif
// Set the position of the icon bitmap // Set the position of the icon bitmap

View File

@ -170,7 +170,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] =
* Public Bitmap Structure Defintions * Public Bitmap Structure Defintions
********************************************************************************************/ ********************************************************************************************/
const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap = const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap =
{ {
CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel
CONFIG_NXWIDGETS_FMT, // fmt - Color format CONFIG_NXWIDGETS_FMT, // fmt - Color format

View File

@ -196,7 +196,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_nshRleEntries[] =
* Public Bitmap Structure Defintions * Public Bitmap Structure Defintions
********************************************************************************************/ ********************************************************************************************/
const struct NXWidgets::SRlePaletteBitmap g_nshBitmap = const struct NXWidgets::SRlePaletteBitmap NxWM::g_nshBitmap =
{ {
CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel
CONFIG_NXWIDGETS_FMT, // fmt - Color format CONFIG_NXWIDGETS_FMT, // fmt - Color format

View File

@ -197,7 +197,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_startRleEntries[] =
* Public Bitmap Structure Defintions * Public Bitmap Structure Defintions
********************************************************************************************/ ********************************************************************************************/
const struct NXWidgets::SRlePaletteBitmap g_startBitmap = const struct NXWidgets::SRlePaletteBitmap NxWM::g_startBitmap =
{ {
CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel
CONFIG_NXWIDGETS_FMT, // fmt - Color format CONFIG_NXWIDGETS_FMT, // fmt - Color format

View File

@ -209,7 +209,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] =
* Public Bitmap Structure Defintions * Public Bitmap Structure Defintions
********************************************************************************************/ ********************************************************************************************/
const struct NXWidgets::SRlePaletteBitmap g_stopBitmap = const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap =
{ {
CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel
CONFIG_NXWIDGETS_FMT, // fmt - Color format CONFIG_NXWIDGETS_FMT, // fmt - Color format

View File

@ -2693,3 +2693,7 @@
* configs/ubw32/up_buttons.c: Added button support for Bit Whacker board. * configs/ubw32/up_buttons.c: Added button support for Bit Whacker board.
* configs/stm3240g-eval/nxconsole: Added a configuration to run the NSH * configs/stm3240g-eval/nxconsole: Added a configuration to run the NSH
shell in an NX window for the STM3240G-EVAL board. shell in an NX window for the STM3240G-EVAL board.
* include/cxx/cunistd: C++ header file to make sure that everything in
unistd.h is in the std:: namespace.
* configs/sim/nxwm: Added a configuration for testing the NuttX Window Manager
(NxWM)

View File

@ -389,6 +389,21 @@ nx11
See apps/examples/README.txt for further details. See apps/examples/README.txt for further details.
nxwm
This is a special configuration setup for the NxWM window manager
UnitTest. The NxWM window manager can be found here:
trunk/NxWidgets/nxwm
The NxWM unit test can be found at:
trunk/NxWidgets/UnitTests/nxwm
Documentation for installing the NxWM unit test can be found here:
trunk/NxWidgets/UnitTests/READEM.txt
ostest ostest
Description Description

View File

@ -73,6 +73,10 @@ CONFIG_SIM_TOUCHSCREEN=n
# CONFIG_DEBUG_VERBOSE - enables verbose debug output # CONFIG_DEBUG_VERBOSE - enables verbose debug output
# CONFIG_DEBUG_SYMBOLS - build without optimization and with # CONFIG_DEBUG_SYMBOLS - build without optimization and with
# debug symbols (needed for use with a debugger). # debug symbols (needed for use with a debugger).
# CONFIG_HAVE_CXX - Enable support for C++
# CONFIG_HAVE_CXXINITIALIZE - The platform-specific logic includes support
# for initialization of static C++ instances for this architecture
# and for the selected toolchain (via up_cxxinitialize()).
# CONFIG_MM_REGIONS - If the architecture includes multiple # CONFIG_MM_REGIONS - If the architecture includes multiple
# regions of memory to allocate from, this specifies the # regions of memory to allocate from, this specifies the
# number of memory regions that the memory manager must # number of memory regions that the memory manager must
@ -134,6 +138,8 @@ CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n CONFIG_DEBUG_SYMBOLS=n
CONFIG_DEBUG_GRAPHICS=y CONFIG_DEBUG_GRAPHICS=y
CONFIG_HAVE_CXX=n
CONFIG_HAVE_CXXINITIALIZE=n
CONFIG_MM_REGIONS=1 CONFIG_MM_REGIONS=1
CONFIG_ARCH_LOWPUTC=y CONFIG_ARCH_LOWPUTC=y
CONFIG_RR_INTERVAL=0 CONFIG_RR_INTERVAL=0

View File

@ -0,0 +1,121 @@
############################################################################
# configs/sim/nxwm/Make.defs
#
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
else
ARCHOPTIMIZATION = -O2
endif
ARCHCPUFLAGS = -fno-builtin
ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
CROSSDEV =
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
OBJEXT = .o
LIBEXT = .a
ifeq ($(HOSTOS),Cygwin)
EXEEXT = .exe
else
EXEEXT =
endif
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif
define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef
define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef
define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.o *.a
endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
HOSTLDFLAGS =

View File

@ -0,0 +1,40 @@
############################################################################
# configs/sim/nxwm/appconfig
#
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# The NSH Library
CONFIGURED_APPS += system/readline
CONFIGURED_APPS += nshlib

View File

@ -0,0 +1,851 @@
############################################################################
# sim/nxwm/defconfig
#
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
CONFIG_NXWM_TASKBAR_LEFT=y
#
# Architecture selection
#
# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
# processor architecture.
# CONFIG_ARCH_name - for use in C code. This identifies the particular
# processor architecture (CONFIG_ARCH_SIM).
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
# the board that supports the particular chip or SoC.
# CONFIG_ARCH_BOARD_name - for use in C code
# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
#
CONFIG_ARCH=sim
CONFIG_ARCH_SIM=y
CONFIG_ARCH_BOARD=sim
CONFIG_ARCH_BOARD_SIM=y
#
# Framebuffer driver options
#
CONFIG_FB_CMAP=n
CONFIG_FB_HWCURSOR=n
CONFIG_FB_HWCURSORIMAGE=n
#CONFIG_FB_HWCURSORSIZE
#CONFIG_FB_TRANSPARENCY
#
# Simulated framebuffer configuration
#
CONFIG_SIM_X11FB=y
CONFIG_SIM_FBWIDTH=480
CONFIG_SIM_FBHEIGHT=240
CONFIG_SIM_FBBPP=32
#
# Simulated touchscreen configuration
# (Set both of the following to 'y' to enable)
#
CONFIG_INPUT=n
CONFIG_SIM_TOUCHSCREEN=n
#
# General OS setup
#
# CONFIG_APPS_DIR - Identifies the relative path to the directory
# that builds the application to link with NuttX. Default: ../apps
# CONFIG_DEBUG - enables built-in debug options
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
# CONFIG_DEBUG_SYMBOLS - build without optimization and with
# debug symbols (needed for use with a debugger).
# debug symbols (needed for use with a debugger).
# CONFIG_HAVE_CXX - Enable support for C++
# CONFIG_HAVE_CXXINITIALIZE - The platform-specific logic includes support
# for initialization of static C++ instances for this architecture
# and for the selected toolchain (via up_cxxinitialize()).
# CONFIG_MM_REGIONS - If the architecture includes multiple
# regions of memory to allocate from, this specifies the
# number of memory regions that the memory manager must
# handle and enables the API mm_addregion(start, end);
# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
# time console output
# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
# or MSEC_PER_TICK=10. This setting may be defined to
# inform NuttX that the processor hardware is providing
# system timer interrupts at some interrupt interval other
# than 10 msec.
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
# this number of milliseconds; Round robin scheduling can
# be disabled by setting this value to zero.
# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
# scheduler to monitor system performance
# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
# task name to save in the TCB. Useful if scheduler
# instrumentation is selected. Set to zero to disable.
# CONFIG_JULIAN_TIME - Enables Julian time conversions
# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
# Used to initialize the internal time logic.
# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
# provides /dev/console. Enables stdout, stderr, stdin.
# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
# driver (minimul support)
# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
# errorcheck mutexes. Enables pthread_mutexattr_settype().
# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
# inheritance on mutexes and semaphores.
# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
# inheritance is enabled. It defines the maximum number of
# different threads (minus one) that can take counts on a
# semaphore with priority inheritance support. This may be
# set to zero if priority inheritance is disabled OR if you
# are only using semaphores as mutexes (only one holder) OR
# if no more than two threads participate using a counting
# semaphore.
# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
# then this setting is the maximum number of higher priority
# threads (minus 1) than can be waiting for another thread
# to release a count on a semaphore. This value may be set
# to zero if no more than one thread is expected to wait for
# a semaphore.
# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
# by task_create() when a new task is started. If set, all
# files/drivers will appear to be closed in the new task.
# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
# three file descriptors (stdin, stdout, stderr) by task_create()
# when a new task is started. If set, all files/drivers will
# appear to be closed in the new task except for stdin, stdout,
# and stderr.
# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
# desciptors by task_create() when a new task is started. If
# set, all sockets will appear to be closed in the new task.
# CONFIG_SCHED_WORKQUEUE. Create a dedicated "worker" thread to
# handle delayed processing from interrupt handlers. This feature
# is required for some drivers but, if there are not complaints,
# can be safely disabled. The worker thread also performs
# garbage collection -- completing any delayed memory deallocations
# from interrupt handlers. If the worker thread is disabled,
# then that clean will be performed by the IDLE thread instead
# (which runs at the lowest of priority and may not be appropriate
# if memory reclamation is of high priority). If CONFIG_SCHED_WORKQUEUE
# is enabled, then the following options can also be used:
# CONFIG_SCHED_WORKPRIORITY - The execution priority of the worker
# thread. Default: 50
# CONFIG_SCHED_WORKPERIOD - How often the worker thread checks for
# work in units of microseconds. Default: 50*1000 (50 MS).
# CONFIG_SCHED_WORKSTACKSIZE - The stack size allocated for the worker
# thread. Default: CONFIG_IDLETHREAD_STACKSIZE.
# CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up
# the worker thread. Default: 4
# CONFIG_SCHED_WAITPID - Enable the waitpid() API
# CONFIG_SCHED_ATEXIT - Enabled the atexit() API
#
#CONFIG_APPS_DIR=
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_GRAPHICS=n
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=n
CONFIG_MM_REGIONS=1
CONFIG_ARCH_LOWPUTC=y
CONFIG_RR_INTERVAL=0
CONFIG_SCHED_INSTRUMENTATION=n
CONFIG_TASK_NAME_SIZE=32
CONFIG_START_YEAR=2012
CONFIG_START_MONTH=5
CONFIG_START_DAY=1
CONFIG_JULIAN_TIME=n
CONFIG_DEV_CONSOLE=y
CONFIG_DEV_LOWCONSOLE=n
CONFIG_MUTEX_TYPES=n
CONFIG_PRIORITY_INHERITANCE=n
CONFIG_SEM_PREALLOCHOLDERS=0
CONFIG_SEM_NNESTPRIO=0
CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SIG_SIGWORK=4
CONFIG_SCHED_WORKQUEUE=n
CONFIG_SCHED_WORKPRIORITY=192
CONFIG_SCHED_WORKPERIOD=(50*1000)
CONFIG_SCHED_WORKSTACKSIZE=8192
CONFIG_SCHED_WAITPID=y
CONFIG_SCHED_ATEXIT=n
#
# The following can be used to disable categories of
# APIs supported by the OS. If the compiler supports
# weak functions, then it should not be necessary to
# disable functions unless you want to restrict usage
# of those APIs.
#
# There are certain dependency relationships in these
# features.
#
# o mq_notify logic depends on signals to awaken tasks
# waiting for queues to become full or empty.
# o pthread_condtimedwait() depends on signals to wake
# up waiting tasks.
#
CONFIG_DISABLE_CLOCK=n
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=n
CONFIG_DISABLE_SIGNALS=n
CONFIG_DISABLE_MQUEUE=n
CONFIG_DISABLE_MOUNTPOINT=n
CONFIG_DISABLE_ENVIRON=n
CONFIG_DISABLE_POLL=y
#
# Misc libc settings
#
# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
# little smaller if we do not support fieldwidthes
#
CONFIG_NOPRINTF_FIELDWIDTH=n
#
# Allow for architecture optimized implementations
#
# The architecture can provide optimized versions of the
# following to improve sysem performance
#
CONFIG_ARCH_MEMCPY=n
CONFIG_ARCH_MEMCMP=n
CONFIG_ARCH_MEMMOVE=n
CONFIG_ARCH_MEMSET=n
CONFIG_ARCH_STRCMP=n
CONFIG_ARCH_STRCPY=n
CONFIG_ARCH_STRNCPY=n
CONFIG_ARCH_STRLEN=n
CONFIG_ARCH_STRNLEN=n
CONFIG_ARCH_BZERO=n
#
# General build options
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
# BSPs from www.ridgerun.com using the tools/mkimage.sh script
# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
# used with many different loaders using the GNU objcopy program
# Should not be selected if you are not using the GNU toolchain.
# CONFIG_RAW_BINARY - make a raw binary format file used with many
# different loaders using the GNU objcopy program. This option
# should not be selected if you are not using the GNU toolchain.
# CONFIG_HAVE_LIBM - toolchain supports libm.a
#
CONFIG_RRLOAD_BINARY=n
CONFIG_INTELHEX_BINARY=n
CONFIG_RAW_BINARY=n
CONFIG_HAVE_LIBM=y
#
# Sizes of configurable things (0 disables)
#
# CONFIG_MAX_TASKS - The maximum number of simultaneously
# active tasks. This value must be a power of two.
# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
# of parameters that a task may receive (i.e., maxmum value
# of 'argc')
# CONFIG_NPTHREAD_KEYS - The number of items of thread-
# specific data that can be retained
# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
# descriptors (one for each open)
# CONFIG_NFILE_STREAMS - The maximum number of streams that
# can be fopen'ed
# CONFIG_NAME_MAX - The maximum size of a file name.
# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_NUNGET_CHARS - Number of characters that can be
# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
# structures. The system manages a pool of preallocated
# message structures to minimize dynamic allocations
# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
# a fixed payload size given by this settin (does not include
# other message structure overhead.
# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
# can be passed to a watchdog handler
# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
# structures. The system manages a pool of preallocated
# watchdog structures to minimize dynamic allocations
# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
# timer structures. The system manages a pool of preallocated
# timer structures to minimize dynamic allocations. Set to
# zero for all dynamic allocations.
#
CONFIG_MAX_TASKS=16
CONFIG_MAX_TASK_ARGS=4
CONFIG_NPTHREAD_KEYS=4
CONFIG_NFILE_DESCRIPTORS=16
CONFIG_NFILE_STREAMS=16
CONFIG_NAME_MAX=32
CONFIG_STDIO_BUFFER_SIZE=1024
CONFIG_NUNGET_CHARS=2
CONFIG_PREALLOC_MQ_MSGS=32
CONFIG_MQ_MAXMSGSIZE=32
CONFIG_MAX_WDOGPARMS=4
CONFIG_PREALLOC_WDOGS=32
CONFIG_PREALLOC_TIMERS=8
#
# Filesystem configuration
#
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
# CONFIG_FAT_LCNAMES - Enable use of the NT-style upper/lower case 8.3
# file name support.
# CONFIG_FAT_LFN - Enable FAT long file names. NOTE: Microsoft claims
# patents on FAT long file name technology. Please read the
# disclaimer in the top-level COPYING file and only enable this
# feature if you understand these issues.
# CONFIG_FAT_MAXFNAME - If CONFIG_FAT_LFN is defined, then the
# default, maximum long file name is 255 bytes. This can eat up
# a lot of memory (especially stack space). If you are willing
# to live with some non-standard, short long file names, then
# define this value. A good choice would be the same value as
# selected for CONFIG_NAME_MAX which will limit the visibility
# of longer file names anyway.
# CONFIG_FS_NXFFS: Enable NuttX FLASH file system (NXFF) support.
# CONFIG_NXFFS_ERASEDSTATE: The erased state of FLASH.
# This must have one of the values of 0xff or 0x00.
# Default: 0xff.
# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
# don't both with file chunks smaller than this number of data bytes.
# CONFIG_NXFFS_MAXNAMLEN: The maximum size of an NXFFS file name.
# Default: 255.
# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
# don't both with file chunks smaller than this number of data bytes.
# Default: 32.
# CONFIG_NXFFS_TAILTHRESHOLD: clean-up can either mean
# packing files together toward the end of the file or, if file are
# deleted at the end of the file, clean up can simply mean erasing
# the end of FLASH memory so that it can be re-used again. However,
# doing this can also harm the life of the FLASH part because it can
# mean that the tail end of the FLASH is re-used too often. This
# threshold determines if/when it is worth erased the tail end of FLASH
# and making it available for re-use (and possible over-wear).
# Default: 8192.
# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
# CONFIG_FS_RAMMAP - For file systems that do not support XIP, this
# option will enable a limited form of memory mapping that is
# implemented by copying whole files into memory.
#
CONFIG_FS_FAT=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=32
CONFIG_FS_NXFFS=n
CONFIG_FS_ROMFS=y
#
# TCP/IP and UDP support via uIP
#
# CONFIG_NET - Enable or disable all network features
# CONFIG_NET_IPv6 - Build in support for IPv6
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
# CONFIG_NET_BUFSIZE - uIP buffer size
# CONFIG_NET_TCP - TCP support on or off
# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
# accept() is called. The size of the backlog is selected when listen() is called.
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
# CONFIG_NET_UDP - UDP support on or off
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
# CONFIG_NET_ICMP - ICMP ping response support on or off
# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
# CONFIG_NET_STATISTICS - uIP statistics on or off
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
# CONFIG_NET_BROADCAST - Broadcast support
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
#
CONFIG_NET=n
CONFIG_NET_IPv6=n
CONFIG_NSOCKET_DESCRIPTORS=0
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
CONFIG_NET_UDP=n
CONFIG_NET_UDP_CHECKSUMS=y
#CONFIG_NET_UDP_CONNS=10
CONFIG_NET_ICMP=n
CONFIG_NET_ICMP_PING=n
#CONFIG_NET_PINGADDRCONF=0
CONFIG_NET_STATISTICS=y
#CONFIG_NET_RECEIVE_WINDOW=
#CONFIG_NET_ARPTAB_SIZE=8
CONFIG_NET_BROADCAST=n
#CONFIG_NET_FWCACHE_SIZE=2
#
# UIP Network Utilities
#
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
#
CONFIG_NET_DHCP_LIGHT=n
CONFIG_NET_RESOLV_ENTRIES=4
#
# Graphics related configuration settings
#
# CONFIG_NX
# Enables overall support for graphics library and NX
# CONFIG_NX_MULTIUSER
# Configures NX in multi-user mode
# 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_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
# CONFIG_NX_DISABLE_32BPP
# NX supports a variety of pixel depths. You can save some
# memory by disabling support for unused color depths.
# CONFIG_NX_PACKEDMSFIRST
# If a pixel depth of less than 8-bits is used, then NX needs
# to know if the pixels pack from the MS to LS or from LS to MS
# CONFIG_NX_MOUSE
# Build in support for mouse input
# CONFIG_NX_KBD
# Build in support of keypad/keyboard input
# CONFIG_NXTK_BORDERWIDTH
# Specifies with with of the border (in pixels) used with
# framed windows. The default is 4.
# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
# Specify the colors of the border used with framed windows.
# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
# is normally darker. The default is medium and dark grey,
# respectively
# CONFIG_NXTK_AUTORAISE
# If set, a window will be raised to the top if the mouse position
# is over a visible portion of the window. Default: A mouse
# button must be clicked over a visible portion of the window.
# CONFIG_NXFONTS_CHARBITS
# The number of bits in the character set. Current options are
# only 7 and 8. The default is 7.
# CONFIG_NXFONT_SANS23X27
# This option enables support for a tiny, 23x27 san serif font
# (font ID FONTID_SANS23X27 == 1).
# CONFIG_NXFONT_SANS22X29
# This option enables support for a small, 22x29 san serif font
# (font ID FONTID_SANS22X29 == 2).
# CONFIG_NXFONT_SANS28X37
# This option enables support for a medium, 28x37 san serif font
# (font ID FONTID_SANS28X37 == 3).
# CONFIG_NXFONT_SANS39X48
# This option enables support for a large, 39x48 san serif font
# (font ID FONTID_SANS39X48 == 4).
# CONFIG_NXFONT_SANS22X29B
# This option enables support for a small, 22x29 san serif bold font
# (font ID FONTID_SANS22X29B == 5).
# CONFIG_NXFONT_SANS28X37B
# This option enables support for a medium, 28x37 san serif bold font
# (font ID FONTID_SANS28X37B == 6).
# CONFIG_NXFONT_SANS40X49B
# This option enables support for a large, 40x49 san serif bold font
# (font ID FONTID_SANS40X49B == 7).
# CONFIG_NXFONT_SERIF22X29
# This option enables support for a small, 22x29 font (with serifs)
# (font ID FONTID_SERIF22X29 == 8).
# CONFIG_NXFONT_SERIF29X37
# This option enables support for a medium, 29x37 font (with serifs)
# (font ID FONTID_SERIF29X37 == 9).
# CONFIG_NXFONT_SERIF38X48
# This option enables support for a large, 38x48 font (with serifs)
# (font ID FONTID_SERIF38X48 == 10).
# CONFIG_NXFONT_SERIF22X28B
# This option enables support for a small, 27x38 bold font (with serifs)
# (font ID FONTID_SERIF22X28B == 11).
# CONFIG_NXFONT_SERIF27X38B
# This option enables support for a medium, 27x38 bold font (with serifs)
# (font ID FONTID_SERIF27X38B == 12).
# CONFIG_NXFONT_SERIF38X49B
# This option enables support for a large, 38x49 bold font (with serifs)
# (font ID FONTID_SERIF38X49B == 13).
#
# NX Multi-user only options:
#
# CONFIG_NX_BLOCKING
# Open the client message queues in blocking mode. In this case,
# nx_eventhandler() will not return until a message is received and processed.
# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
# Specifies the maximum number of messages that can fit in
# the message queues. No additional resources are allocated, but
# this can be set to prevent flooding of the client or server with
# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many
# messages are pre-allocated).
#
CONFIG_NX=y
CONFIG_NX_MULTIUSER=y
CONFIG_NX_NPLANES=1
CONFIG_NX_DISABLE_1BPP=y
CONFIG_NX_DISABLE_2BPP=y
CONFIG_NX_DISABLE_4BPP=y
CONFIG_NX_DISABLE_8BPP=y
CONFIG_NX_DISABLE_16BPP=y
CONFIG_NX_DISABLE_24BPP=y
CONFIG_NX_DISABLE_32BPP=n
CONFIG_NX_PACKEDMSFIRST=n
CONFIG_NX_MOUSE=y
CONFIG_NX_KBD=y
#CONFIG_NXTK_BORDERWIDTH=4
#CONFIG_NXTK_BORDERCOLOR1
#CONFIG_NXTK_BORDERCOLOR2
CONFIG_NXTK_AUTORAISE=n
CONFIG_NXFONT_SANS22X29=n
CONFIG_NXFONT_SANS23X27=y
CONFIG_NXFONT_SANS28X37=n
CONFIG_NXFONT_SANS22X29B=n
CONFIG_NXFONT_SANS28X37B=y
CONFIG_NXFONT_SANS40X49B=n
CONFIG_NXFONT_SERIF22X29=n
CONFIG_NXFONT_SERIF29X37=n
CONFIG_NXFONT_SERIF38X48=n
CONFIG_NXFONT_SERIF22X28B=n
CONFIG_NXFONT_SERIF27X38B=n
CONFIG_NXFONT_SERIF38X49B=n
CONFIG_NXFONTS_CHARBITS=7
CONFIG_NX_BLOCKING=y
CONFIG_NX_MXSERVERMSGS=32
CONFIG_NX_MXCLIENTMSGS=16
#
# NxWidgets
#
CONFIG_NXWIDGETS_SERVERSTACK=16384
CONFIG_NXWIDGETS_LISTENERSTACK=8192
#
# NxConsole Configuration Settings:
#
# CONFIG_NXCONSOLE
# Enables building of the NxConsole driver.
# CONFIG_NXCONSOLE_BPP
# 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
# internal memory allocations used to hold the character data. Default: 128.
# CONFIG_NXCONSOLE_CACHESIZE
# NxConsole supports caching of rendered fonts. This font caching is required
# for two reasons: (1) First, it improves text performance, but more
# importantly (2) it preserves the font memory. Since the NX server runs on
# a separate server thread, it requires that the rendered font memory persist
# until the server has a chance to render the font. (NOTE: There is still
# inherently a race condition in this!). Unfortunately, the font cache would
# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
# will control the size of the font cache (in number of glyphs). Only that
# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
# By default, lines will wrap when the test reaches the right hand side
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=32
# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
#
# Settings for examples/uip
#
CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
CONFIG_EXAMPLE_UIP_DHCPC=n
#
# Settings for examples/nettest
#
CONFIG_EXAMPLE_NETTEST_SERVER=n
CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
CONFIG_EXAMPLE_NETTEST_NOMAC=n
CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
#
# Settings for examples/ostest
#
CONFIG_EXAMPLES_OSTEST_LOOPS=100
CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
#
# Settings for apps/nshlib
#
# CONFIG_NSH_BUILTIN_APPS - Support external registered,
# "named" applications that can be executed from the NSH
# command line (see apps/README.txt for more information).
# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
# CONFIG_NSH_STRERROR - Use strerror(errno)
# CONFIG_NSH_LINELEN - Maximum length of one command line
# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
# CONFIG_NSH_DISABLEBG - Disable background commands
# CONFIG_NSH_ROMFSETC - Use startup script in /etc
# CONFIG_NSH_CONSOLE - Use serial console front end
# CONFIG_NSH_TELNET - Use telnetd console front end
#
# If CONFIG_NSH_TELNET is selected:
# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
# CONFIG_NSH_DHCPC - Obtain address using DHCP
# CONFIG_NSH_IPADDR - Provides static IP address
# CONFIG_NSH_DRIPADDR - Provides static router IP address
# CONFIG_NSH_NETMASK - Provides static network mask
# CONFIG_NSH_NOMAC - Use a bogus MAC address
#
# If CONFIG_NSH_ROMFSETC is selected:
# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
# CONFIG_NSH_INITSCRIPT - Relative path to init script
# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
#
CONFIG_NSH_BUILTIN_APPS=n
CONFIG_NSH_FILEIOSIZE=1024
CONFIG_NSH_STRERROR=n
CONFIG_NSH_LINELEN=80
CONFIG_NSH_NESTDEPTH=3
CONFIG_NSH_DISABLESCRIPT=n
CONFIG_NSH_DISABLEBG=n
CONFIG_NSH_ROMFSETC=y
CONFIG_NSH_CONSOLE=y
CONFIG_NSH_TELNET=n
CONFIG_NSH_IOBUFFER_SIZE=512
CONFIG_NSH_DHCPC=n
CONFIG_NSH_NOMAC=n
CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
CONFIG_NSH_ROMFSMOUNTPT="/etc"
CONFIG_NSH_INITSCRIPT="init.d/rcS"
CONFIG_NSH_ROMFSDEVNO=1
CONFIG_NSH_ROMFSSECTSIZE=64
CONFIG_NSH_FATDEVNO=2
CONFIG_NSH_FATSECTSIZE=512
CONFIG_NSH_FATNSECTORS=1024
CONFIG_NSH_FATMOUNTPT=/tmp
#
# Settings for examples/nx
#
# CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in"
# that can be executed from the NSH command line
# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame-
# buffer driver for use in the test. Default: 0
# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
# CONFIG_EXAMPLES_NX_BPP.
# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
# include 2, 4, 8, 16, 24, and 32. Default is 32.
# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to
# use pretty, framed NXTK windows with toolbars.
# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating
# the NX server. Default 2048
# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80
# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120
# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with
# nx_eventnotify(). Default: 4
#
CONFIG_EXAMPLES_NX_BUILTIN=n
CONFIG_EXAMPLES_NX_VPLANE=0
#CONFIG_EXAMPLES_NX_BGCOLOR
#CONFIG_EXAMPLES_NX_COLOR1
#CONFIG_EXAMPLES_NX_COLOR2
#CONFIG_EXAMPLES_NX_TBCOLOR
#CONFIG_EXAMPLES_NX_FONTCOLOR
CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP
CONFIG_EXAMPLES_NX_RAWWINDOWS=n
CONFIG_EXAMPLES_NX_STACKSIZE=8192
CONFIG_EXAMPLES_NX_CLIENTPRIO=80
CONFIG_EXAMPLES_NX_SERVERPRIO=120
CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
#
# Settings for examples/nxhello
#
# CONFIG_EXAMPLES_NXHELLO_BUILTIN -- Build the NXHELLO example as a "built-in"
# that can be executed from the NSH command line
# CONFIG_EXAMPLES_NXHELLO_VPLANE -- The plane to select from the frame-
# buffer driver for use in the test. Default: 0
# CONFIG_EXAMPLES_NXHELLO_BGCOLOR -- The color of the background. Default
# depends on CONFIG_EXAMPLES_NXHELLO_BPP.
# CONFIG_EXAMPLES_NXHELLO_FONTID - Selects the font (see font ID numbers in
# include/nuttx/nx/nxfonts.h)
# CONFIG_EXAMPLES_NXHELLO_FONTCOLOR -- The color of the fonts used in the
# background window. Default depends on CONFIG_EXAMPLES_NXHELLO_BPP.
# CONFIG_EXAMPLES_NXHELLO_BPP -- Pixels per pixel to use. Valid options
# include 2, 4, 8, 16, 24, and 32. Default is 32.
# CONFIG_EXAMPLES_NXHELLO_EXTERNINIT - The driver for the graphics device on
# this platform requires some unusual initialization. This is the
# for, for example, SPI LCD/OLED devices. If this configuration is
# selected, then the platform code must provide an LCD initialization
# function.
#
CONFIG_EXAMPLES_NXHELLO_BUILTIN=y
CONFIG_EXAMPLES_NXHELLO_VPLANE=0
#CONFIG_EXAMPLES_NXHELLO_BGCOLOR
CONFIG_EXAMPLES_NXHELLO_FONTID=6
#CONFIG_EXAMPLES_NXHELLO_FONTCOLOR
CONFIG_EXAMPLES_NXHELLO_BPP=CONFIG_SIM_FBBPP
CONFIG_EXAMPLES_NXHELLO_EXTERNINIT=n
#
# Settings for examples/nxlines
#
# CONFIG_EXAMPLES_NXLINES_BUILTIN -- Build the NXLINES example as a "built-in"
# that can be executed from the NSH command line
# CONFIG_EXAMPLES_NXLINES_VPLANE -- The plane to select from the frame-
# buffer driver for use in the test. Default: 0
# CONFIG_EXAMPLES_NXLINES_BGCOLOR -- The color of the background. Default
# depends on CONFIG_EXAMPLES_NXLINES_BPP.
# CONFIG_EXAMPLES_NXLINES_LINEWIDTH - Selects the width of the lines in
# pixels (default: 16)
# CONFIG_EXAMPLES_NXLINES_LINECOLOR -- The color of the central lines drawn
# in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
# (there really is no meaningful default).
# CONFIG_EXAMPLES_NXLINES_BORDERWIDTH -- The width of the circular border
# drawn in the background window. (default: 4).
# CONFIG_EXAMPLES_NXLINES_BORDERCOLOR -- The color of the circular border
# drawn in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
# (there really is no meaningful default).
# CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR -- The color of the circular region
# filled in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
# (there really is no meaningful default).
# CONFIG_EXAMPLES_NXLINES_BPP -- Pixels per pixel to use. Valid options
# include 2, 4, 8, 16, 24, and 32. Default is 16.
# CONFIG_EXAMPLES_NXLINES_EXTERNINIT - The driver for the graphics device on
# this platform requires some unusual initialization. This is the
# for, for example, SPI LCD/OLED devices. If this configuration is
# selected, then the platform code must provide an LCD initialization
# function.
#
CONFIG_EXAMPLES_NXLINES_BUILTIN=n
CONFIG_EXAMPLES_NXLINES_VPLANE=0
#CONFIG_EXAMPLES_NXLINES_BGCOLOR
CONFIG_EXAMPLES_NXLINES_LINEWIDTH=16
#CONFIG_EXAMPLES_NXLINES_LINECOLOR
CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=4
#CONFIG_EXAMPLES_NXLINES_BORDERCOLOR
#CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR
CONFIG_EXAMPLES_NXLINES_BPP=CONFIG_SIM_FBBPP
CONFIG_EXAMPLES_NXLINES_EXTERNINIT=n
#
# Settings for examples/touchscreen
#
# CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN - Build the touchscreen test as
# an NSH built-in function. Default: Built as a standalone problem
# CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
# correspnds to touchscreen device /dev/input0. Note this value must
# with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
# CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH - The path to the touchscreen
# device. This must be consistent with CONFIG_EXAMPLES_TOUCHSCREEN_MINOR.
# Default: "/dev/input0"
# CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES - If CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN
# is defined, then the number of samples is provided on the command line
# and this value is ignored. Otherwise, this number of samples is
# collected and the program terminates. Default: Samples are collected
# indefinitely.
#
CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES=25
#
# Settings for examples/mount
#
CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
#
# Stack and heap information
#
# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
# operation from FLASH but must copy initialized .data sections to RAM.
# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
# but copy themselves entirely into RAM for better performance.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
# all stack operations outside of the nuttx model.
# CONFIG_STACK_POINTER - The initial stack pointer
# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
# This is the thread that (1) performs the inital boot of the system up
# to the point where user_start() is spawned, and (2) there after is the
# IDLE thread that executes only when there is no other thread ready to
# run.
# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
# for the main user thread that begins at the user_start() entry point.
# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_IDLETHREAD_STACKSIZE=8192
CONFIG_USERMAIN_STACKSIZE=8192
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=8192
CONFIG_HEAP_BASE=
CONFIG_HEAP_SIZE=

View File

@ -0,0 +1,45 @@
#!/bin/bash
# sim/nxwm/setenv.sh
#
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
if [ "$(basename $0)" = "setenv.sh" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
#export NUTTX_BIN=
#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
echo "PATH : ${PATH}"

70
nuttx/include/cxx/cunistd Executable file
View File

@ -0,0 +1,70 @@
//***************************************************************************
// include/cxx/cunistd
//
// Copyright (C) 2012 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// 3. Neither the name NuttX nor the names of its contributors may be
// used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//***************************************************************************
#ifndef __INCLUDE_CXX_CUNISTD
#define __INCLUDE_CXX_CUNISTD
//***************************************************************************
// Included Files
//***************************************************************************
#include <unistd.h>
//***************************************************************************
// Namespace
//***************************************************************************
namespace std
{
using ::getpid;
using ::_exit;
using ::close;
using ::dup;
using ::dup2;
using ::fsync;
using ::lseek;
using ::read;
using ::write;
using ::pipe;
using ::chdir;
using ::getcwd;
using ::unlink;
using ::rmdir;
using ::getopt;
using ::getoptargp;
using ::getopindgp;
using ::getoptoptp;
}
#endif // __INCLUDE_CXX_CUNISTD