demo: use kernel heap memory pool for the monitor stack if CONFIG_KERN_HEAP is enabled.
[bertos.git] / examples / demo / demo.c
index 5a6f50773ba29f41fd29c028ff2f1120f3e90d3f..b5b2ca0467903e08de90d9d02d7b26a53303ce24 100644 (file)
@@ -294,22 +294,22 @@ 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[])
 {
        emul_init(&argc, argv);
 
-       #if CONFIG_KERN_PREEMPT
-               irq_init();
-       #endif
        timer_init();
        buz_init();
        kbd_init();
        lcd_init();
        proc_init();
-       monitor_start(sizeof(monitor_stack), monitor_stack);
+       monitor_start(KERN_MINSTACKSIZE, monitor_stack);
 
        menu_handle(&main_menu);