summaryrefslogtreecommitdiff
path: root/apps/examples/nxtext/nxtext_main.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-08 19:41:48 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-08 19:41:48 +0000
commit487bc7ed3b401ffd54ae3988368c92fe7551d9b1 (patch)
treebecf6bc12118c122ecfd882a03e0936da62e5be5 /apps/examples/nxtext/nxtext_main.c
parent8ab28535bd5b776e1a5b1a6b3e8ae078986acf6d (diff)
downloadpx4-nuttx-487bc7ed3b401ffd54ae3988368c92fe7551d9b1.tar.gz
px4-nuttx-487bc7ed3b401ffd54ae3988368c92fe7551d9b1.tar.bz2
px4-nuttx-487bc7ed3b401ffd54ae3988368c92fe7551d9b1.zip
Fix a few NXTEXT bugs (there are many more)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3756 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxtext/nxtext_main.c')
-rw-r--r--apps/examples/nxtext/nxtext_main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c
index ce598c1a6..08f79169b 100644
--- a/apps/examples/nxtext/nxtext_main.c
+++ b/apps/examples/nxtext/nxtext_main.c
@@ -44,7 +44,6 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
-#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
@@ -332,10 +331,6 @@ int user_start(int argc, char *argv[])
int bkgndx;
int ret;
- /* Seed the random number generator */
-
- srand(0x1234);
-
/* Initialize NX */
ret = nxtext_initialize();
@@ -403,6 +398,13 @@ int user_start(int argc, char *argv[])
message("user_start: Close pop-up\n");
(void)nxpu_close(hwnd);
+
+ /* NOTE: The following should not be necessary. This is
+ * a temporary workaround for a bug in the TOD list:
+ * "When a window is closed, the display is not updated."
+ */
+
+ nxbg_refresh(g_bgwnd);
popcnt = 0;
}
else if (popcnt >= 3)
@@ -411,7 +413,7 @@ int user_start(int argc, char *argv[])
hwnd = nxpu_open();
- /* Give keyboard input to the top window */
+ /* Give keyboard input to the top window (which should be the pop-up) */
#ifdef CONFIG_NX_KBD
message("user_start: Send keyboard input: %s\n", g_pumsg);
@@ -428,7 +430,7 @@ int user_start(int argc, char *argv[])
* text to go the background by calling the kbdin method directly.
*/
- nxbg_write(g_hnx, (FAR const uint8_t *)g_bgmsg[bkgndx], strlen(g_bgmsg[bkgndx]));
+ nxbg_write(g_bgwnd, (FAR const uint8_t *)g_bgmsg[bkgndx], strlen(g_bgmsg[bkgndx]));
if (++bkgndx >= BGMSG_LINES)
{
bkgndx = 0;
@@ -445,7 +447,7 @@ errout_with_hwnd:
}
//errout_with_bkgd:
- (void)nx_releasebkgd(g_hnx);
+ (void)nx_releasebkgd(g_bgwnd);
errout_with_nx:
#ifdef CONFIG_NX_MULTIUSER