From 15d0007e9687428fe314e1369a9bb4eeb427cfcc Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 3 Apr 2015 12:48:22 +0000 Subject: Mass change, all thread functions now return void. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7849 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32F0xx/ADC/main.c | 6 +++--- testhal/STM32/STM32F0xx/EXT/main.c | 2 +- testhal/STM32/STM32F0xx/IRQ_STORM/main.c | 6 +++--- testhal/STM32/STM32F0xx/PWM-ICU/main.c | 2 +- testhal/STM32/STM32F0xx/SPI/main.c | 16 +++++++--------- testhal/STM32/STM32F0xx/UART/main.c | 2 +- testhal/STM32/STM32F0xx/USB_CDC/main.c | 6 +++--- 7 files changed, 19 insertions(+), 21 deletions(-) (limited to 'testhal/STM32/STM32F0xx') diff --git a/testhal/STM32/STM32F0xx/ADC/main.c b/testhal/STM32/STM32F0xx/ADC/main.c index 8b36522c5..00471e038 100644 --- a/testhal/STM32/STM32F0xx/ADC/main.c +++ b/testhal/STM32/STM32F0xx/ADC/main.c @@ -84,11 +84,11 @@ static const ADCConversionGroup adcgrpcfg2 = { * Red LEDs blinker thread, times are in milliseconds. */ static THD_WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { +static THD_FUNCTION(Thread1, arg) { (void)arg; chRegSetThreadName("blinker"); - while (TRUE) { + while (true) { palSetPad(GPIOC, GPIOC_LED4); chThdSleepMilliseconds(500); palClearPad(GPIOC, GPIOC_LED4); @@ -142,7 +142,7 @@ int main(void) { /* * Normal main() thread activity, in this demo it does nothing. */ - while (TRUE) { + while (true) { if (palReadPad(GPIOA, GPIOA_BUTTON)) { adcStopConversion(&ADCD1); adcSTM32SetCCR(0); diff --git a/testhal/STM32/STM32F0xx/EXT/main.c b/testhal/STM32/STM32F0xx/EXT/main.c index 51844bbda..171983f00 100644 --- a/testhal/STM32/STM32F0xx/EXT/main.c +++ b/testhal/STM32/STM32F0xx/EXT/main.c @@ -89,7 +89,7 @@ int main(void) { * Normal main() thread activity, in this demo it enables and disables the * button EXT channel using 5 seconds intervals. */ - while (TRUE) { + while (true) { chThdSleepMilliseconds(5000); extChannelDisable(&EXTD1, 0); chThdSleepMilliseconds(5000); diff --git a/testhal/STM32/STM32F0xx/IRQ_STORM/main.c b/testhal/STM32/STM32F0xx/IRQ_STORM/main.c index 9127ac762..ef5e498a9 100644 --- a/testhal/STM32/STM32F0xx/IRQ_STORM/main.c +++ b/testhal/STM32/STM32F0xx/IRQ_STORM/main.c @@ -58,7 +58,7 @@ static msg_t b[NUM_THREADS][MAILBOX_SIZE]; * Test worker threads. */ static THD_WORKING_AREA(waWorkerThread[NUM_THREADS], 128); -static msg_t WorkerThread(void *arg) { +static THD_FUNCTION(WorkerThread, arg) { static volatile unsigned x = 0; static unsigned cnt = 0; unsigned me = (unsigned)arg; @@ -69,7 +69,7 @@ static msg_t WorkerThread(void *arg) { chRegSetThreadName("worker"); /* Work loop.*/ - while (TRUE) { + while (true) { /* Waiting for a message.*/ chMBFetch(&mb[me], &msg, TIME_INFINITE); @@ -325,7 +325,7 @@ int main(void) { /* * Normal main() thread activity, nothing in this test. */ - while (TRUE) { + while (true) { chThdSleepMilliseconds(5000); } return 0; diff --git a/testhal/STM32/STM32F0xx/PWM-ICU/main.c b/testhal/STM32/STM32F0xx/PWM-ICU/main.c index 084929b17..bf700e4f1 100644 --- a/testhal/STM32/STM32F0xx/PWM-ICU/main.c +++ b/testhal/STM32/STM32F0xx/PWM-ICU/main.c @@ -141,7 +141,7 @@ int main(void) { /* * Normal main() thread activity, in this demo it does nothing. */ - while (TRUE) { + while (true) { chThdSleepMilliseconds(500); } return 0; diff --git a/testhal/STM32/STM32F0xx/SPI/main.c b/testhal/STM32/STM32F0xx/SPI/main.c index b0e4c1c3b..8e5fa0458 100644 --- a/testhal/STM32/STM32F0xx/SPI/main.c +++ b/testhal/STM32/STM32F0xx/SPI/main.c @@ -49,11 +49,11 @@ static uint8_t rxbuf[512]; * SPI bus contender 1. */ static THD_WORKING_AREA(spi_thread_1_wa, 256); -static msg_t spi_thread_1(void *p) { +static THD_FUNCTION(spi_thread_1, p) { (void)p; chRegSetThreadName("SPI thread 1"); - while (TRUE) { + while (true) { spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */ palSetPad(GPIOC, GPIOC_LED4); /* LED ON. */ spiStart(&SPID2, &hs_spicfg); /* Setup transfer parameters. */ @@ -63,18 +63,17 @@ static msg_t spi_thread_1(void *p) { spiUnselect(&SPID2); /* Slave Select de-assertion. */ spiReleaseBus(&SPID2); /* Ownership release. */ } - return 0; } /* * SPI bus contender 2. */ static THD_WORKING_AREA(spi_thread_2_wa, 256); -static msg_t spi_thread_2(void *p) { +static THD_FUNCTION(spi_thread_2, p) { (void)p; chRegSetThreadName("SPI thread 2"); - while (TRUE) { + while (true) { spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */ palClearPad(GPIOC, GPIOC_LED4); /* LED OFF. */ spiStart(&SPID2, &ls_spicfg); /* Setup transfer parameters. */ @@ -84,18 +83,17 @@ static msg_t spi_thread_2(void *p) { spiUnselect(&SPID2); /* Slave Select de-assertion. */ spiReleaseBus(&SPID2); /* Ownership release. */ } - return 0; } /* * This is a periodic thread that does absolutely nothing except flashing * a LED. */ static THD_WORKING_AREA(blinker_wa, 128); -static msg_t blinker(void *arg) { +static THD_FUNCTION(blinker, arg) { (void)arg; chRegSetThreadName("blinker"); - while (TRUE) { + while (true) { palSetPad(GPIOC, GPIOC_LED3); chThdSleepMilliseconds(500); palClearPad(GPIOC, GPIOC_LED3); @@ -155,7 +153,7 @@ int main(void) { /* * Normal main() thread activity, in this demo it does nothing. */ - while (TRUE) { + while (true) { chThdSleepMilliseconds(500); } return 0; diff --git a/testhal/STM32/STM32F0xx/UART/main.c b/testhal/STM32/STM32F0xx/UART/main.c index 2c7f79b34..363607890 100644 --- a/testhal/STM32/STM32F0xx/UART/main.c +++ b/testhal/STM32/STM32F0xx/UART/main.c @@ -136,7 +136,7 @@ int main(void) { /* * Normal main() thread activity, in this demo it does nothing. */ - while (TRUE) { + while (true) { chThdSleepMilliseconds(500); } } diff --git a/testhal/STM32/STM32F0xx/USB_CDC/main.c b/testhal/STM32/STM32F0xx/USB_CDC/main.c index 43ac2c294..2866b85ce 100644 --- a/testhal/STM32/STM32F0xx/USB_CDC/main.c +++ b/testhal/STM32/STM32F0xx/USB_CDC/main.c @@ -438,11 +438,11 @@ static const ShellConfig shell_cfg1 = { * Red LED blinker thread, times are in milliseconds. */ static THD_WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { +static THD_FUNCTION(Thread1, arg) { (void)arg; chRegSetThreadName("blinker"); - while (TRUE) { + while (true) { systime_t time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500; palClearPad(GPIOC, GPIOC_LED_RED); chThdSleepMilliseconds(time); @@ -497,7 +497,7 @@ int main(void) { * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and check the button state. */ - while (TRUE) { + while (true) { if (!shelltp && (SDU1.config->usbp->state == USB_ACTIVE)) shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); else if (chThdTerminatedX(shelltp)) { -- cgit v1.2.3