aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F30x
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32F30x')
-rw-r--r--testhal/STM32/STM32F30x/ADC/main.c7
-rw-r--r--testhal/STM32/STM32F30x/ADC_DUAL/main.c7
-rw-r--r--testhal/STM32/STM32F30x/CAN/main.c8
-rw-r--r--testhal/STM32/STM32F30x/EXT/main.c2
-rw-r--r--testhal/STM32/STM32F30x/IRQ_STORM/main.c6
-rw-r--r--testhal/STM32/STM32F30x/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F30x/SPI/main.c16
-rw-r--r--testhal/STM32/STM32F30x/UART/main.c2
-rw-r--r--testhal/STM32/STM32F30x/USB_CDC/main.c6
-rw-r--r--testhal/STM32/STM32F30x/USB_CDC_IAD/main.c6
10 files changed, 28 insertions, 34 deletions
diff --git a/testhal/STM32/STM32F30x/ADC/main.c b/testhal/STM32/STM32F30x/ADC/main.c
index 046757687..0686becb7 100644
--- a/testhal/STM32/STM32F30x/ADC/main.c
+++ b/testhal/STM32/STM32F30x/ADC/main.c
@@ -105,17 +105,16 @@ 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(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
}
- return 0;
}
/*
@@ -163,7 +162,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);
}
diff --git a/testhal/STM32/STM32F30x/ADC_DUAL/main.c b/testhal/STM32/STM32F30x/ADC_DUAL/main.c
index 98fc6dd72..b77e267b2 100644
--- a/testhal/STM32/STM32F30x/ADC_DUAL/main.c
+++ b/testhal/STM32/STM32F30x/ADC_DUAL/main.c
@@ -129,17 +129,16 @@ 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(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
}
- return 0;
}
/*
@@ -187,7 +186,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);
}
diff --git a/testhal/STM32/STM32F30x/CAN/main.c b/testhal/STM32/STM32F30x/CAN/main.c
index a1f281cf9..e9511c17b 100644
--- a/testhal/STM32/STM32F30x/CAN/main.c
+++ b/testhal/STM32/STM32F30x/CAN/main.c
@@ -31,7 +31,7 @@ static const CANConfig cancfg = {
* Receiver thread.
*/
static THD_WORKING_AREA(can_rx_wa, 256);
-static msg_t can_rx(void *p) {
+static THD_FUNCTION(can_rx, p) {
event_listener_t el;
CANRxFrame rxmsg;
@@ -47,14 +47,13 @@ static msg_t can_rx(void *p) {
}
}
chEvtUnregister(&CAND1.rxfull_event, &el);
- return 0;
}
/*
* Transmitter thread.
*/
static THD_WORKING_AREA(can_tx_wa, 256);
-static msg_t can_tx(void * p) {
+static THD_FUNCTION(can_tx, p) {
CANTxFrame txmsg;
(void)p;
@@ -70,7 +69,6 @@ static msg_t can_tx(void * p) {
canTransmit(&CAND1, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
- return 0;
}
/*
@@ -102,7 +100,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/STM32F30x/EXT/main.c b/testhal/STM32/STM32F30x/EXT/main.c
index a8800a141..c905da39f 100644
--- a/testhal/STM32/STM32F30x/EXT/main.c
+++ b/testhal/STM32/STM32F30x/EXT/main.c
@@ -93,7 +93,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/STM32F30x/IRQ_STORM/main.c b/testhal/STM32/STM32F30x/IRQ_STORM/main.c
index 2472d0a75..09d922afe 100644
--- a/testhal/STM32/STM32F30x/IRQ_STORM/main.c
+++ b/testhal/STM32/STM32F30x/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);
@@ -329,7 +329,7 @@ int main(void) {
/*
* Normal main() thread activity, nothing in this test.
*/
- while (TRUE) {
+ while (true) {
chThdSleepMilliseconds(5000);
}
}
diff --git a/testhal/STM32/STM32F30x/PWM-ICU/main.c b/testhal/STM32/STM32F30x/PWM-ICU/main.c
index d1bc47e5f..ee9f8a8d2 100644
--- a/testhal/STM32/STM32F30x/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F30x/PWM-ICU/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);
}
return 0;
diff --git a/testhal/STM32/STM32F30x/SPI/main.c b/testhal/STM32/STM32F30x/SPI/main.c
index b7e6398b2..62610dfa5 100644
--- a/testhal/STM32/STM32F30x/SPI/main.c
+++ b/testhal/STM32/STM32F30x/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(GPIOE, GPIOE_LED10_RED); /* 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(GPIOE, GPIOE_LED10_RED);/* 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(GPIOE, GPIOE_LED3_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOE, GPIOE_LED3_RED);
@@ -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/STM32F30x/UART/main.c b/testhal/STM32/STM32F30x/UART/main.c
index 68a9e31c6..35d48f70b 100644
--- a/testhal/STM32/STM32F30x/UART/main.c
+++ b/testhal/STM32/STM32F30x/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/STM32F30x/USB_CDC/main.c b/testhal/STM32/STM32F30x/USB_CDC/main.c
index 834a9c2c6..c40a82cb1 100644
--- a/testhal/STM32/STM32F30x/USB_CDC/main.c
+++ b/testhal/STM32/STM32F30x/USB_CDC/main.c
@@ -445,11 +445,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(GPIOE, GPIOE_LED3_RED);
chThdSleepMilliseconds(time);
@@ -504,7 +504,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)) {
diff --git a/testhal/STM32/STM32F30x/USB_CDC_IAD/main.c b/testhal/STM32/STM32F30x/USB_CDC_IAD/main.c
index b3d664317..bada16558 100644
--- a/testhal/STM32/STM32F30x/USB_CDC_IAD/main.c
+++ b/testhal/STM32/STM32F30x/USB_CDC_IAD/main.c
@@ -154,11 +154,11 @@ static const ShellConfig shell_cfg2 = {
* 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 = serusbcfg1.usbp->state == USB_ACTIVE ? 250 : 500;
palClearPad(GPIOE, GPIOE_LED3_RED);
chThdSleepMilliseconds(time);
@@ -216,7 +216,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 (!shelltp1 && (SDU1.config->usbp->state == USB_ACTIVE))
shelltp1 = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp1)) {