X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Fdemo%2Fdemo.c;h=ed64a12d404f78ac6ef3e2703955d8da9c5e18fc;hb=2c856edc9728d1f74a614b2009dc9372aae79aa2;hp=4d0172f9ef62f07c77f464e5f38090e44134a5d3;hpb=04e7f227ba5a6a87fe2f903cd607c905e20f7184;p=bertos.git diff --git a/app/demo/demo.c b/app/demo/demo.c index 4d0172f9..ed64a12d 100644 --- a/app/demo/demo.c +++ b/app/demo/demo.c @@ -32,24 +32,30 @@ * * \version $Id: demo.c 18242 2007-10-08 17:35:23Z marco $ * - * \author Bernardo Innocenti + * \author Bernie Innocenti * * \brief Windowing system test. */ +#include + #include + #include +#include + #include #include #include #include + #include #include #include #include + #include #include -#include /** * Draw a pentacle in the provided bitmap. @@ -101,7 +107,7 @@ static void bouncing_logo(Bitmap *bm) const long SPEED_SCALE = 1000; const long GRAVITY_ACCEL = 10; const long BOUNCE_ELASTICITY = 2; - long h = (long)(-project_grl_logo.height) * SPEED_SCALE; + long h = (long)(-bertos_logo.height) * SPEED_SCALE; long speed = 1000; /* Repeat until logo stands still on the bottom edge */ @@ -123,9 +129,9 @@ static void bouncing_logo(Bitmap *bm) /* Update graphics */ gfx_bitmapClear(bm); gfx_blitImage(bm, - (bm->width - project_grl_logo.width) / 2, + (bm->width - bertos_logo.width) / 2, h / SPEED_SCALE, - &project_grl_logo); + &bertos_logo); lcd_blitBitmap(bm); timer_delay(10); @@ -217,9 +223,13 @@ void win_demo(Bitmap *bm) void proc_demo(void) { - extern void proc_test(void); -// FIXME: proc_test() cause segmentation fault. - proc_test(); + proc_testRun(); +} + +void timer_demo(void) +{ + timer_testRun(); + timer_testTearDown(); } @@ -272,6 +282,7 @@ static struct MenuItem main_items[] = { (const_iptr_t)"Bounce!", 0, (MenuHook)bouncing_logo,(iptr_t)&lcd_bitmap }, { (const_iptr_t)"Hello World", 0, (MenuHook)hello_world, (iptr_t)&lcd_bitmap }, { (const_iptr_t)"Scheduling", 0, (MenuHook)proc_demo, (iptr_t)&lcd_bitmap }, + { (const_iptr_t)"Timer Test", 0, (MenuHook)timer_demo, (iptr_t)&lcd_bitmap }, { (const_iptr_t)"Menu MX", 0, (MenuHook)menu_handle, (iptr_t)&mx_menu }, { (const_iptr_t)"Display", 0, (MenuHook)menu_handle, (iptr_t)&display_menu }, { (const_iptr_t)"Settings", 0, (MenuHook)menu_handle, (iptr_t)&settings_menu }, @@ -291,6 +302,7 @@ int main(int argc, char *argv[]) menu_handle(&main_menu); + timer_cleanup(); emul_cleanup(); return 0; }