demo: wait for a keypress event instead of sleeping for a second in hello_world(...
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 22 Mar 2010 17:39:08 +0000 (17:39 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 22 Mar 2010 17:39:08 +0000 (17:39 +0000)
This allows to correctly process GUI events during the hello_world()
test in the emulated demo.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3261 38d2e660-2303-0410-9eaa-f027e97ec537

examples/demo/demo.c

index 0dbce6e96daa7c83273df5341ec83211541c5b78..de9ddeb0bfa78a9235f47a56f23bbe394d815eb3 100644 (file)
@@ -95,8 +95,9 @@ static void hello_world(Bitmap *bm)
        text_xprintf(bm, 1, 0, STYLEF_BOLD | TEXT_FILL | TEXT_CENTER,
                        "Hello, world!");
        schedule();
-
-       timer_delay(1000);
+       while (1)
+               if (kbd_peek())
+                       break;
 
        /* Restore old font */
        gfx_setFont(bm, old_font);