From 56b11565bac09ccfd7228d2f466e34809c251b90 Mon Sep 17 00:00:00 2001 From: arighi Date: Wed, 12 May 2010 16:32:46 +0000 Subject: [PATCH] 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 --- examples/stm32p103/main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); } -- 2.25.1