From: arighi Date: Fri, 19 Mar 2010 11:25:27 +0000 (+0000) Subject: demo: use kernel heap memory pool for the monitor stack if CONFIG_KERN_HEAP is enabled. X-Git-Tag: 2.4.0~19 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=2dcafe56095edd5c07139d7b150a4c8321cd83ee;p=bertos.git demo: use kernel heap memory pool for the monitor stack if CONFIG_KERN_HEAP is enabled. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3245 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/examples/demo/demo.c b/examples/demo/demo.c index 559152a7..b5b2ca04 100644 --- a/examples/demo/demo.c +++ b/examples/demo/demo.c @@ -294,8 +294,11 @@ static struct MenuItem main_items[] = }; static struct Menu main_menu = { main_items, "Main Menu", MF_STICKY, &lcd_bitmap, 0 }; - -static cpu_stack_t monitor_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpu_stack_t)]; +#if CONFIG_KERN_HEAP +#define monitor_stack NULL +#else +static PROC_DEFINE_STACK(monitor_stack, KERN_MINSTACKSIZE); +#endif int main(int argc, char *argv[]) { @@ -306,7 +309,7 @@ int main(int argc, char *argv[]) kbd_init(); lcd_init(); proc_init(); - monitor_start(sizeof(monitor_stack), monitor_stack); + monitor_start(KERN_MINSTACKSIZE, monitor_stack); menu_handle(&main_menu);