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
* Process monitor.
* $WIZ$ type = "autoenabled"
*/
-#define CONFIG_KERN_MONITOR 0
+#define CONFIG_KERN_MONITOR 1
#endif /* CFG_MONITOR_H */
*
* $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.
* Inter-process signals.
* $WIZ$ type = "autoenabled"
*/
-#define CONFIG_KERN_SIGNALS 0
+#define CONFIG_KERN_SIGNALS 1
#endif /* CFG_SIGNAL_H */
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);
}
}
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