* 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!
* $WIZ$ type = "boolean"
* $WIZ$ conditional_deps = "timer"
*/
-#define CONFIG_KERN_PREEMPT 0
+#define CONFIG_KERN_PREEMPT 1
/**
* Time sharing quantum (a prime number prevents interference effects) [ms].
* 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 16384L
/**
* Module logging level.
lpc2378_USER_CSRC = \
examples/lpc2378/main.c \
bertos/drv/timer.c \
+ bertos/drv/timer_test.c \
bertos/cpu/arm/drv/vic_lpc2.c \
bertos/cpu/arm/drv/timer_lpc2.c \
+ bertos/mware/event.c \
+ bertos/kern/proc.c \
+ bertos/kern/coop.c \
+ bertos/kern/preempt.c \
+ bertos/kern/proc_test.c \
+ bertos/kern/monitor.c \
+ bertos/mware/sprintf.c \
+ bertos/struct/heap.c \
#
# Files included by the user.
# Files included by the user.
lpc2378_USER_CPPASRC = \
+ bertos/cpu/arm/hw/switch_ctx_arm.S \
#
# Files included by the user.
IRQ_ENABLE;
kdbg_init();
timer_init();
+ proc_init();
+ timer_delay(3000);
kprintf("NXP LPC2378 BeRTOS port test\n");
+ timer_delay(3000);
/* Turn off boot led */
IODIR0 = (1<<21);
IOCLR0 = (1<<21);
LED_OFF();
}
-int main(void)
+static void NORETURN bertos_up(void)
{
char spinner[] = {'/', '-', '\\', '|'};
int i = 0;
-
- init();
while (1)
{
i++;
+ proc_forbid();
kprintf("BeRTOS is up & running: %c\r",
spinner[i % countof(spinner)]);
+ proc_permit();
+ timer_delay(100);
+ }
+}
+
+static void NORETURN status(void)
+{
+ while (1)
+ {
LED_ON();
- timer_delay(500);
+ timer_delay(250);
LED_OFF();
- timer_delay(500);
+ timer_delay(250);
+ }
+}
+
+int main(void)
+{
+
+ init();
+ proc_testRun();
+ proc_new(bertos_up, NULL, KERN_MINSTACKSIZE * 3, NULL);
+ proc_new(status, NULL, 0, NULL);
+ while (1)
+ {
}
return 0;