From: arighi Date: Wed, 12 May 2010 16:32:46 +0000 (+0000) Subject: stm32p103: create a distinct process to blink the status LED in the example application. X-Git-Tag: 2.5.0~244 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=56b11565bac09ccfd7228d2f466e34809c251b90;p=bertos.git stm32p103: create a distinct process to blink the status LED in the example application. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3673 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/examples/stm32p103/main.c b/examples/stm32p103/main.c index de49bbb5..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,9 +73,9 @@ 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("BeRTOS up & running!\n"); timer_delay(500); }