projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the 'edit' parameter, no more needed.
[bertos.git]
/
examples
/
lpc2378
/
main.c
diff --git
a/examples/lpc2378/main.c
b/examples/lpc2378/main.c
index baf48c5c666e7e6655e4d9bb523589dd1e3e8368..213e96117f2c6c3294002cacc539b1781f126419 100644
(file)
--- a/
examples/lpc2378/main.c
+++ b/
examples/lpc2378/main.c
@@
-1,7
+1,7
@@
// Emtpy main.c file generated by the wizard
#include <cpu/irq.h>
#include <cfg/debug.h>
// Emtpy main.c file generated by the wizard
#include <cpu/irq.h>
#include <cfg/debug.h>
-
+#include <drv/timer.h>
#include <io/lpc23xx.h>
#define STATUS_LED (1<<19)
#include <io/lpc23xx.h>
#define STATUS_LED (1<<19)
@@
-12,7
+12,11
@@
static void init(void)
{
IRQ_ENABLE;
kdbg_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);
@@
-21,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();
-
for (int j = 0; j < 200000; j++
);
+
timer_delay(250
);
LED_OFF();
LED_OFF();
- for (int j = 0; j < 200000; j++ );
+ 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;