projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lm3s1968: use the fixed-width Gohufont in the example.
[bertos.git]
/
examples
/
lpc2378
/
main.c
diff --git
a/examples/lpc2378/main.c
b/examples/lpc2378/main.c
index 7ab7b8594bdb31f6fac10102e2358d509635c751..213e96117f2c6c3294002cacc539b1781f126419 100644
(file)
--- a/
examples/lpc2378/main.c
+++ b/
examples/lpc2378/main.c
@@
-13,7
+13,10
@@
static void init(void)
IRQ_ENABLE;
kdbg_init();
timer_init();
IRQ_ENABLE;
kdbg_init();
timer_init();
+ proc_init();
+ timer_delay(3000);
kprintf("NXP LPC2378 BeRTOS port test\n");
kprintf("NXP LPC2378 BeRTOS port test\n");
+ timer_delay(3000);
/* Turn off boot led */
IODIR0 = (1<<21);
IOCLR0 = (1<<21);
/* Turn off boot led */
IODIR0 = (1<<21);
IOCLR0 = (1<<21);
@@
-22,22
+25,42
@@
static void init(void)
LED_OFF();
}
LED_OFF();
}
-
int main
(void)
+
static void NORETURN bertos_up
(void)
{
char spinner[] = {'/', '-', '\\', '|'};
int i = 0;
{
char spinner[] = {'/', '-', '\\', '|'};
int i = 0;
-
- init();
while (1)
{
i++;
while (1)
{
i++;
+ proc_forbid();
kprintf("BeRTOS is up & running: %c\r",
spinner[i % countof(spinner)]);
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();
LED_ON();
- timer_delay(
50
0);
+ timer_delay(
25
0);
LED_OFF();
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;
}
return 0;