diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-20 22:10:34 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-20 22:10:34 +0000 |
commit | 7b639cc17a46229cacb9eca78a451a66122c54d8 (patch) | |
tree | 33492e787345ddef26740d5a9c1282f59324c2b0 /NxWidgets/UnitTests/nxwm | |
parent | 01bce341a9d065e8250f655c246c07a525779bc0 (diff) | |
download | nuttx-7b639cc17a46229cacb9eca78a451a66122c54d8.tar.gz nuttx-7b639cc17a46229cacb9eca78a451a66122c54d8.tar.bz2 nuttx-7b639cc17a46229cacb9eca78a451a66122c54d8.zip |
Add an NxWM console/keyboard thread and eliminate all issues with NxConsole window serial input
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4755 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/UnitTests/nxwm')
-rw-r--r-- | NxWidgets/UnitTests/nxwm/main.cxx | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/main.cxx index 86ea324d5..3cc85dc43 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/main.cxx @@ -53,6 +53,10 @@ # include "ccalibration.hxx" #endif +#ifdef CONFIG_NXWM_KEYBOARD +# include "ckeyboard.hxx" +#endif + ///////////////////////////////////////////////////////////////////////////// // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// @@ -408,7 +412,7 @@ static bool createTouchScreen(void) printf("createTouchScreen: ERROR: Failed to create CTouchscreen\n"); return false; } - showTestCaseMemory("createTouchScreen: createTouchScreen: After creating CTouchscreen"); + showTestCaseMemory("createTouchScreen: After creating CTouchscreen"); printf("createTouchScreen: Start touchscreen listener\n"); if (!g_nxwmtest.touchscreen->start()) @@ -424,6 +428,35 @@ static bool createTouchScreen(void) #endif ///////////////////////////////////////////////////////////////////////////// +// Name: createKeyboard +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_KEYBOARD +static bool createKeyboard(void) +{ + printf("createKeyboard: Creating CKeyboard\n"); + NxWM::CKeyboard *keyboard = new NxWM::CKeyboard(g_nxwmtest.taskbar); + if (!keyboard) + { + printf("createKeyboard: ERROR: Failed to create CKeyboard\n"); + return false; + } + showTestCaseMemory("createKeyboard After creating CKeyboard"); + + printf("createKeyboard: Start keyboard listener\n"); + if (!keyboard->start()) + { + printf("createKeyboard: ERROR: Failed start the keyboard listener\n"); + delete keyboard; + return false; + } + + showTestCaseMemory("createKeyboard: After starting the keyboard listener"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// // Name: createCalibration ///////////////////////////////////////////////////////////////////////////// @@ -574,6 +607,16 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the keyboard device + +#ifdef CONFIG_NXWM_KEYBOARD + if (!createKeyboard()) + { + printf(MAIN_STRING "ERROR: Failed to create the keyboard\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Create the touchscreen device #ifdef CONFIG_NXWM_TOUCHSCREEN |