X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Fstm32p103%2Fmain.c;h=483852e2148263abc988f5ca505c9402424687c0;hb=391b4f8d9c82c413f2cd11fb3ba3aeb311f62184;hp=4ca8ea3cf7a321e27b959203bcf6deae483eaa46;hpb=660d3a3e0f7129ed821a2ba44473254eaea728ce;p=bertos.git diff --git a/examples/stm32p103/main.c b/examples/stm32p103/main.c index 4ca8ea3c..483852e2 100644 --- a/examples/stm32p103/main.c +++ b/examples/stm32p103/main.c @@ -52,6 +52,17 @@ static void led_init(void) LED_PIN, GPIO_MODE_OUT_PP, GPIO_SPEED_50MHZ); } +static void NORETURN led_process(void) +{ + int i; + + for (i = 0; ; i = !i) + { + stm32_gpioPinWrite((struct stm32_gpio *)GPIOC_BASE, LED_PIN, i); + timer_delay(250); + } +} + int main(void) { int i; @@ -62,10 +73,10 @@ int main(void) proc_init(); led_init(); + proc_new(led_process, NULL, KERN_MINSTACKSIZE, NULL); for (i = 0; ; i = !i) { - stm32_gpioPinWrite((struct stm32_gpio *)GPIOC_BASE, LED_PIN, i); - kputs("hello world\n"); + kputs("BeRTOS up & running!\n"); timer_delay(500); } }