lm3s1968: enable the kernel in the example.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 31 Mar 2010 14:41:58 +0000 (14:41 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 31 Mar 2010 14:41:58 +0000 (14:41 +0000)
This enables kernel, signals, dynamic memory allocator and process
priorities in the lm3s1968 example and execute the proc_test testcase.

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

examples/lm3s1968/cfg/cfg_monitor.h
examples/lm3s1968/cfg/cfg_proc.h
examples/lm3s1968/cfg/cfg_signal.h
examples/lm3s1968/lm3s1968.c
examples/lm3s1968/lm3s1968.mk

index 78f222bfd3e8412c4a53031cbce2342b481dffc1..d0e24da428f6c4dc1f410ec276b799174f781c75 100644 (file)
@@ -42,6 +42,6 @@
  * Process monitor.
  * $WIZ$ type = "autoenabled"
  */
-#define CONFIG_KERN_MONITOR 0
+#define CONFIG_KERN_MONITOR 1
 
 #endif /*  CFG_MONITOR_H */
index 3c9439fb0b002097067e74d87e98ffb16ea57e89..0f47739d77c513d61bb249bc96fe95e5edf38dfc 100644 (file)
@@ -43,7 +43,7 @@
  *
  * $WIZ$ type = "autoenabled"
  */
-#define CONFIG_KERN 0
+#define CONFIG_KERN 1
 
 /**
  * Kernel interrupt supervisor. WARNING: Experimental, still incomplete!
  * Priority-based scheduling policy.
  * $WIZ$ type = "boolean"
  */
-#define CONFIG_KERN_PRI 0
+#define CONFIG_KERN_PRI 1
 
 /**
  * Dynamic memory allocation for processes.
  * $WIZ$ type = "boolean"
  * $WIZ$ conditional_deps = "heap"
  */
-#define CONFIG_KERN_HEAP 0
+#define CONFIG_KERN_HEAP 1
 
 /**
  * Size of the dynamic memory pool used by processes.
  * $WIZ$ type = "int"
  * $WIZ$ min = 0
  */
-#define CONFIG_KERN_HEAP_SIZE 2048L
+#define CONFIG_KERN_HEAP_SIZE 8192L
 
 /**
  * Module logging level.
index e48d86a6e43fea23f26963f45378a48f2772f569..ce5324ec10ea5086817a3f77e054e8fe38e3ac1e 100644 (file)
@@ -42,6 +42,6 @@
  * Inter-process signals.
  * $WIZ$ type = "autoenabled"
  */
-#define CONFIG_KERN_SIGNALS 0
+#define CONFIG_KERN_SIGNALS 1
 
 #endif /*  CFG_SIGNAL_H */
index 9dfaf006a868f1cdb86b2fc2c0ae950c4ffc6466..edf7211071c1951f4e4d385c7ae91d5f357b4193 100644 (file)
@@ -63,20 +63,34 @@ static void led_off(void)
        GPIO_PORTG_DATA_R &= ~0x04;
 }
 
+static NORETURN void spinner_thread(void)
+{
+       char spinner[] = {'/', '-', '\\', '|'};
+       int i;
+
+       kputs("\n");
+       for(i = 0; ; i++)
+       {
+               kprintf("BeRTOS is up & running: %c\r",
+                               spinner[i % countof(spinner)]);
+               timer_delay(100);
+       }
+}
+
 int main(void)
 {
        IRQ_ENABLE;
-       kdbg_init();
-       timer_init();
        led_init();
 
+       proc_testSetup();
+       proc_testRun();
+
+       proc_new(spinner_thread, NULL, KERN_MINSTACKSIZE, NULL);
        while(1)
        {
-               kputs("STATUS LED: on \r");
                led_on();
-               timer_delay(1000);
-               kputs("STATUS LED: off\r");
+               timer_delay(250);
                led_off();
-               timer_delay(1000);
+               timer_delay(250);
        }
 }
index b96e7bc99d349bb2356b66fd62eda28255dc334c..453fddafafe5c2ab3b709078d6254dae3b3f40e4 100644 (file)
@@ -20,18 +20,30 @@ lm3s1968_CSRC = \
        bertos/mware/formatwr.c \
        bertos/mware/hex.c \
        bertos/mware/sprintf.c \
+       bertos/mware/event.c \
+       bertos/struct/heap.c \
        bertos/drv/timer.c \
+       bertos/kern/monitor.c \
+       bertos/kern/proc_test.c \
+       bertos/kern/proc.c \
+       bertos/kern/coop.c \
+       bertos/kern/preempt.c \
+       bertos/kern/signal.c \
        bertos/cpu/cortex-m3/drv/irq_lm3s.c \
        bertos/cpu/cortex-m3/drv/timer_lm3s.c \
        bertos/cpu/cortex-m3/drv/clock_lm3s.c \
        bertos/cpu/cortex-m3/drv/kdebug_lm3s.c \
        bertos/cpu/cortex-m3/hw/startup_lm3s.c
 
+lm3s1968_CPPASRC = \
+       bertos/cpu/cortex-m3/hw/switch_ctx_cm3.S \
+       #
+
 # This is an hosted application
 lm3s1968_PREFIX = arm-none-eabi-
 
-lm3s1968_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug -mthumb -fno-strict-aliasing -fwrapv
-lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(50000000L)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -mthumb  -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv
+lm3s1968_CPPAFLAGS = -g -gdwarf-2 -mthumb -fno-strict-aliasing -fwrapv
+lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(50000000L)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv
 lm3s1968_LDFLAGS = -nostartfiles -T bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld -Wl,--no-warn-mismatch -fno-strict-aliasing -fwrapv
 
 lm3s1968_CPU = cortex-m3