aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F37x
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32F37x')
-rw-r--r--testhal/STM32/STM32F37x/ADC/main.c5
-rw-r--r--testhal/STM32/STM32F37x/CAN/main.c4
-rw-r--r--testhal/STM32/STM32F37x/EXT/main.c2
-rw-r--r--testhal/STM32/STM32F37x/I2C/main.c5
-rw-r--r--testhal/STM32/STM32F37x/IRQ_STORM/main.c6
-rw-r--r--testhal/STM32/STM32F37x/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F37x/SDADC/main.c5
-rw-r--r--testhal/STM32/STM32F37x/SPI/main.c10
-rw-r--r--testhal/STM32/STM32F37x/UART/main.c2
-rw-r--r--testhal/STM32/STM32F37x/USB_CDC/main.c4
10 files changed, 19 insertions, 26 deletions
diff --git a/testhal/STM32/STM32F37x/ADC/main.c b/testhal/STM32/STM32F37x/ADC/main.c
index fb6f5c8f4..063683a3d 100644
--- a/testhal/STM32/STM32F37x/ADC/main.c
+++ b/testhal/STM32/STM32F37x/ADC/main.c
@@ -111,13 +111,12 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
palSetPad(GPIOC, GPIOC_LED1);
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_WKUP_BUTTON)) {
adcStopConversion(&ADCD1);
}
diff --git a/testhal/STM32/STM32F37x/CAN/main.c b/testhal/STM32/STM32F37x/CAN/main.c
index 21da0b697..5b50a102e 100644
--- a/testhal/STM32/STM32F37x/CAN/main.c
+++ b/testhal/STM32/STM32F37x/CAN/main.c
@@ -47,7 +47,6 @@ static THD_FUNCTION(can_rx, p) {
}
}
chEvtUnregister(&CAND1.rxfull_event, &el);
- return 0;
}
/*
@@ -70,7 +69,6 @@ static THD_FUNCTION(can_tx, 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/STM32F37x/EXT/main.c b/testhal/STM32/STM32F37x/EXT/main.c
index 296478d84..3ce6a34f3 100644
--- a/testhal/STM32/STM32F37x/EXT/main.c
+++ b/testhal/STM32/STM32F37x/EXT/main.c
@@ -91,7 +91,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/STM32F37x/I2C/main.c b/testhal/STM32/STM32F37x/I2C/main.c
index 92a7c0ab9..5eb3dcbaa 100644
--- a/testhal/STM32/STM32F37x/I2C/main.c
+++ b/testhal/STM32/STM32F37x/I2C/main.c
@@ -50,13 +50,12 @@ static THD_FUNCTION(blinker, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
}
- return 0;
}
/*
@@ -88,7 +87,7 @@ int main(void) {
/*
* Normal main() thread activity, in this demo it does nothing.
*/
- while (TRUE) {
+ while (true) {
unsigned i;
msg_t msg;
static const uint8_t cmd[] = {0, 0};
diff --git a/testhal/STM32/STM32F37x/IRQ_STORM/main.c b/testhal/STM32/STM32F37x/IRQ_STORM/main.c
index 34ae66902..f7a2fd642 100644
--- a/testhal/STM32/STM32F37x/IRQ_STORM/main.c
+++ b/testhal/STM32/STM32F37x/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);
@@ -328,7 +328,7 @@ int main(void) {
/*
* Normal main() thread activity, nothing in this test.
*/
- while (TRUE) {
+ while (true) {
chThdSleepMilliseconds(5000);
}
}
diff --git a/testhal/STM32/STM32F37x/PWM-ICU/main.c b/testhal/STM32/STM32F37x/PWM-ICU/main.c
index 5188ad9b3..bb23765d2 100644
--- a/testhal/STM32/STM32F37x/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F37x/PWM-ICU/main.c
@@ -134,7 +134,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/STM32F37x/SDADC/main.c b/testhal/STM32/STM32F37x/SDADC/main.c
index 2abf339b3..1285a5793 100644
--- a/testhal/STM32/STM32F37x/SDADC/main.c
+++ b/testhal/STM32/STM32F37x/SDADC/main.c
@@ -108,13 +108,12 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
}
- return 0;
}
/*
@@ -156,7 +155,7 @@ int main(void) {
/*
* Normal main() thread activity, in this demo it does nothing.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON)) {
adcStopConversion(&SDADCD1);
}
diff --git a/testhal/STM32/STM32F37x/SPI/main.c b/testhal/STM32/STM32F37x/SPI/main.c
index f15de5a1f..a2de89200 100644
--- a/testhal/STM32/STM32F37x/SPI/main.c
+++ b/testhal/STM32/STM32F37x/SPI/main.c
@@ -54,7 +54,7 @@ static THD_FUNCTION(spi_thread_1, p) {
(void)p;
chRegSetThreadName("SPI thread 1");
- while (TRUE) {
+ while (true) {
spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
palClearPad(GPIOC, GPIOC_LED2); /* LED ON. */
spiStart(&SPID2, &hs_spicfg); /* Setup transfer parameters. */
@@ -64,7 +64,6 @@ static THD_FUNCTION(spi_thread_1, p) {
spiUnselect(&SPID2); /* Slave Select de-assertion. */
spiReleaseBus(&SPID2); /* Ownership release. */
}
- return 0;
}
/*
@@ -76,7 +75,7 @@ static THD_FUNCTION(spi_thread_2, p) {
(void)p;
chRegSetThreadName("SPI thread 2");
- while (TRUE) {
+ while (true) {
spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
palSetPad(GPIOC, GPIOC_LED2); /* LED OFF. */
spiStart(&SPID2, &ls_spicfg); /* Setup transfer parameters. */
@@ -86,7 +85,6 @@ static THD_FUNCTION(spi_thread_2, p) {
spiUnselect(&SPID2); /* Slave Select de-assertion. */
spiReleaseBus(&SPID2); /* Ownership release. */
}
- return 0;
}
/*
@@ -99,7 +97,7 @@ static THD_FUNCTION(blinker, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
palClearPad(GPIOC, GPIOC_LED1);
@@ -154,7 +152,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/STM32F37x/UART/main.c b/testhal/STM32/STM32F37x/UART/main.c
index dc1a80b58..5ce33d16d 100644
--- a/testhal/STM32/STM32F37x/UART/main.c
+++ b/testhal/STM32/STM32F37x/UART/main.c
@@ -134,7 +134,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/STM32F37x/USB_CDC/main.c b/testhal/STM32/STM32F37x/USB_CDC/main.c
index 516181b64..9eea7d19c 100644
--- a/testhal/STM32/STM32F37x/USB_CDC/main.c
+++ b/testhal/STM32/STM32F37x/USB_CDC/main.c
@@ -449,7 +449,7 @@ 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_LED1);
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)) {