From c523fa6f7aa0e64600e0a82082bd4067cbc2a4a5 Mon Sep 17 00:00:00 2001 From: Jonathan Struebel Date: Mon, 18 Apr 2016 20:40:13 -0700 Subject: [PATCH] [KINETIS] Moved time variable definition in blinker thread --- demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/main.c | 2 +- testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c | 4 ++-- testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/main.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/main.c b/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/main.c index f789ad19..0f4da4da 100644 --- a/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/main.c +++ b/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/main.c @@ -26,12 +26,12 @@ SerialConfig s0cfg = { */ static THD_WORKING_AREA(waBlinkThread, 128); static THD_FUNCTION(BlinkThread, arg) { + systime_t time = 500; (void)arg; chRegSetThreadName("blinker"); while (true) { - systime_t time = 500; palTogglePad(GPIO_LED_BLUE, PIN_LED_BLUE); chThdSleepMilliseconds(time); } diff --git a/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c b/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c index 616c7c68..a6c90bf2 100644 --- a/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c +++ b/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c @@ -91,12 +91,12 @@ static const ShellConfig shell_cfg1 = { */ static THD_WORKING_AREA(waThread1, 128); static THD_FUNCTION(Thread1, arg) { + systime_t time; (void)arg; + chRegSetThreadName("blinker"); while (true) { - systime_t time; - time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500; palClearPad(GPIO_LED_RED, PIN_LED_RED); chThdSleepMilliseconds(time); diff --git a/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/main.c b/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/main.c index 897dc58e..77c60632 100644 --- a/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/main.c +++ b/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/main.c @@ -91,12 +91,12 @@ static const ShellConfig shell_cfg1 = { */ static THD_WORKING_AREA(waThread1, 128); static THD_FUNCTION(Thread1, arg) { + systime_t time; (void)arg; + chRegSetThreadName("blinker"); while (true) { - systime_t time; - time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500; palClearPad(GPIO_LED_RED, PIN_LED_RED); chThdSleepMilliseconds(time);