projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/stm32f103-nucleo: Use more bits
[fw/altos]
/
src
/
stm32f103-nucleo
/
hello.c
diff --git
a/src/stm32f103-nucleo/hello.c
b/src/stm32f103-nucleo/hello.c
index 938afd2d706ba3767343c7c8f744b159f26822e3..1571eae4f5427c457ba3b352c0dd6ce7796daeef 100644
(file)
--- a/
src/stm32f103-nucleo/hello.c
+++ b/
src/stm32f103-nucleo/hello.c
@@
-18,21
+18,25
@@
#include <ao.h>
#include <ao.h>
-void
-ao_delay(AO_TICK_TYPE ticks)
+static void blink(void)
{
{
- uint32_t then = ao_time();
- while ((int32_t) (ao_time() - then) < (int32_t) ticks)
- ao_arch_nop();
+ for (;;) {
+ ao_led_for(AO_LED_GREEN, 50);
+ ao_delay(50);
+ }
}
}
+static struct ao_task blink_task;
+
int main(void)
{
ao_clock_init();
int main(void)
{
ao_clock_init();
- ao_timer_init();
ao_led_init();
ao_led_init();
- for (;;) {
- ao_led_for(AO_LED_GREEN, 50);
- ao_delay(50);
- }
+ ao_timer_init();
+ ao_serial_init();
+ ao_usb_init();
+ ao_task_init();
+ ao_cmd_init();
+ ao_add_task(&blink_task, blink, "blink");
+ ao_start_scheduler();
}
}