Add an NxWM console/keyboard thread and eliminate all issues with NxConsole window serial input

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4755 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-05-20 22:10:34 +00:00
parent 3a6013aae5
commit 602575e7c9
14 changed files with 551 additions and 22 deletions
+44 -1
View File
@@ -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())
@@ -423,6 +427,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