aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-03 12:48:22 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-03 12:48:22 +0000
commit15d0007e9687428fe314e1369a9bb4eeb427cfcc (patch)
tree0ac60d4ec0245764ad601d763b0d3d5dc7c76539 /demos
parent67b6d6cebf167faaf544886e1b1f41aaa404cb35 (diff)
downloadChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.tar.gz
ChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.tar.bz2
ChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.zip
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
Diffstat (limited to 'demos')
-rw-r--r--demos/AVR/RT-ARDUINOMEGA/main.c3
-rw-r--r--demos/KINETIS/RT-FREEDOM-K20D50M/main.c12
-rw-r--r--demos/KINETIS/RT-FREEDOM-KL25Z/main.c12
-rw-r--r--demos/KINETIS/RT-MCHCK-K20-SPI/main.c4
-rw-r--r--demos/KINETIS/RT-TEENSY3/main.c8
-rw-r--r--demos/LPC21xx/RT-LPC214x-OLIMEX/main.c6
-rw-r--r--demos/SPC5/NIL-SPC560D-EVB/main.c2
-rw-r--r--demos/SPC5/RT-SPC560B-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC560D-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC560P-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC563M-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC564A-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC56EC-EVB/main.c7
-rw-r--r--demos/SPC5/RT-SPC56EL-EVB/main.c7
-rw-r--r--demos/STM32/CMSIS-STM32F407-DISCOVERY/main.c4
-rw-r--r--demos/STM32/RT-STM32F030R8-NUCLEO/main.c4
-rw-r--r--demos/STM32/RT-STM32F051-DISCOVERY/main.c6
-rw-r--r--demos/STM32/RT-STM32F072-DISCOVERY/main.c6
-rw-r--r--demos/STM32/RT-STM32F100-DISCOVERY/main.c2
-rw-r--r--demos/STM32/RT-STM32F103-MAPLEMINI/main.c4
-rw-r--r--demos/STM32/RT-STM32F103-OLIMEX_STM32_P103/main.c2
-rw-r--r--demos/STM32/RT-STM32F103RB-NUCLEO/main.c4
-rw-r--r--demos/STM32/RT-STM32F103_INEMO_DISCOVERY/main.c4
-rw-r--r--demos/STM32/RT-STM32F303-DISCOVERY/main.c2
-rw-r--r--demos/STM32/RT-STM32F334R8-NUCLEO/main.c4
-rw-r--r--demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c4
-rw-r--r--demos/STM32/RT-STM32F401RE-NUCLEO/main.c4
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY-MEMS/main.c4
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/main.c4
-rw-r--r--demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/main.c4
-rw-r--r--demos/STM32/RT-STM32F411RE-NUCLEO/main.c4
-rw-r--r--demos/STM32/RT-STM32F429-DISCOVERY/main.c6
-rw-r--r--demos/STM32/RT-STM32L152-DISCOVERY/main.c2
-rw-r--r--demos/STM32/RT-STM32L152RE-NUCLEO/main.c4
-rw-r--r--demos/various/RT-Win32-Simulator/main.c3
35 files changed, 76 insertions, 101 deletions
diff --git a/demos/AVR/RT-ARDUINOMEGA/main.c b/demos/AVR/RT-ARDUINOMEGA/main.c
index 0228c440b..4db566c40 100644
--- a/demos/AVR/RT-ARDUINOMEGA/main.c
+++ b/demos/AVR/RT-ARDUINOMEGA/main.c
@@ -21,11 +21,10 @@
static WORKING_AREA(waThread1, 32);
static msg_t Thread1(void *arg) {
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT2, PORTB_LED1);
chThdSleepMilliseconds(1000);
}
- return 0;
}
/*
diff --git a/demos/KINETIS/RT-FREEDOM-K20D50M/main.c b/demos/KINETIS/RT-FREEDOM-K20D50M/main.c
index 4a65f5234..9a2ca0eb9 100644
--- a/demos/KINETIS/RT-FREEDOM-K20D50M/main.c
+++ b/demos/KINETIS/RT-FREEDOM-K20D50M/main.c
@@ -23,12 +23,10 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("RedBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT3, 3);
chThdSleepMilliseconds(300);
}
-
- return 0;
}
static THD_WORKING_AREA(waThread2, 64);
@@ -36,12 +34,10 @@ static THD_FUNCTION(Thread2, arg) {
(void)arg;
chRegSetThreadName("GreenBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT4, 4);
chThdSleepMilliseconds(600);
}
-
- return 0;
}
static THD_WORKING_AREA(waThread3, 64);
@@ -49,12 +45,10 @@ static THD_FUNCTION(Thread3, arg) {
(void)arg;
chRegSetThreadName("BlueBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT1, 2);
chThdSleepMilliseconds(900);
}
-
- return 0;
}
/*
diff --git a/demos/KINETIS/RT-FREEDOM-KL25Z/main.c b/demos/KINETIS/RT-FREEDOM-KL25Z/main.c
index f4cf28678..d565ca041 100644
--- a/demos/KINETIS/RT-FREEDOM-KL25Z/main.c
+++ b/demos/KINETIS/RT-FREEDOM-KL25Z/main.c
@@ -23,12 +23,10 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("RedBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT2, 18);
chThdSleepMilliseconds(300);
}
-
- return 0;
}
static THD_WORKING_AREA(waThread2, 64);
@@ -36,12 +34,10 @@ static THD_FUNCTION(Thread2, arg) {
(void)arg;
chRegSetThreadName("GreenBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT2, 19);
chThdSleepMilliseconds(600);
}
-
- return 0;
}
static THD_WORKING_AREA(waThread3, 64);
@@ -49,12 +45,10 @@ static THD_FUNCTION(Thread3, arg) {
(void)arg;
chRegSetThreadName("BlueBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT4, 1);
chThdSleepMilliseconds(900);
}
-
- return 0;
}
/*
diff --git a/demos/KINETIS/RT-MCHCK-K20-SPI/main.c b/demos/KINETIS/RT-MCHCK-K20-SPI/main.c
index b7530d2f2..909475944 100644
--- a/demos/KINETIS/RT-MCHCK-K20-SPI/main.c
+++ b/demos/KINETIS/RT-MCHCK-K20-SPI/main.c
@@ -42,7 +42,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("Blinker");
- while (TRUE) {
+ while (true) {
palSetPad(GPIOB, GPIOB_LED);
/* Send the Manufacturer and Device ID Read command */
@@ -54,8 +54,6 @@ static THD_FUNCTION(Thread1, arg) {
chThdSleepMilliseconds(1000);
}
-
- return 0;
}
/*
diff --git a/demos/KINETIS/RT-TEENSY3/main.c b/demos/KINETIS/RT-TEENSY3/main.c
index 9a541206d..591bd0ff8 100644
--- a/demos/KINETIS/RT-TEENSY3/main.c
+++ b/demos/KINETIS/RT-TEENSY3/main.c
@@ -22,16 +22,14 @@
* LED blinker thread.
*/
static THD_WORKING_AREA(waThread1, 64);
-static msg_t Thread1(void *arg) {
+static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("LEDBlinker");
- while (TRUE) {
+ while (true) {
palTogglePad(IOPORT3, PORTC_TEENSY_PIN13);
chThdSleepMilliseconds(500);
}
-
- return 0;
}
/*
@@ -60,7 +58,7 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
TestThread(&SD1);
- while (TRUE) {
+ while (true) {
chThdSleepMilliseconds(1000);
}
diff --git a/demos/LPC21xx/RT-LPC214x-OLIMEX/main.c b/demos/LPC21xx/RT-LPC214x-OLIMEX/main.c
index 062027136..b01c1915f 100644
--- a/demos/LPC21xx/RT-LPC214x-OLIMEX/main.c
+++ b/demos/LPC21xx/RT-LPC214x-OLIMEX/main.c
@@ -28,7 +28,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker1");
- while (TRUE) {
+ while (true) {
palClearPort(IOPORT1, PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(200);
palSetPort(IOPORT1, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
@@ -48,7 +48,7 @@ static THD_FUNCTION(Thread2, arg) {
(void)arg;
chRegSetThreadName("blinker2");
- while (TRUE) {
+ while (true) {
palClearPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(200);
palSetPad(IOPORT1, PA_LEDUSB);
@@ -86,7 +86,7 @@ int main(void) {
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the buttons state and run test procedure.
*/
- while (TRUE) {
+ while (true) {
if (!palReadPad(IOPORT1, PA_BUTTON1))
sdWrite(&SD1, (uint8_t *)"Hello World!\r\n", 14);
if (!palReadPad(IOPORT1, PA_BUTTON2))
diff --git a/demos/SPC5/NIL-SPC560D-EVB/main.c b/demos/SPC5/NIL-SPC560D-EVB/main.c
index d40169dd3..d24e0cec7 100644
--- a/demos/SPC5/NIL-SPC560D-EVB/main.c
+++ b/demos/SPC5/NIL-SPC560D-EVB/main.c
@@ -31,7 +31,7 @@ static THD_FUNCTION(Thread1, arg) {
*/
sdStart(&SD1, NULL);
- while (TRUE) {
+ while (true) {
unsigned i;
chnWriteTimeout(&SD1, (uint8_t *)"Hello World!\r\n", 14, TIME_INFINITE);
diff --git a/demos/SPC5/RT-SPC560B-EVB/main.c b/demos/SPC5/RT-SPC560B-EVB/main.c
index 044dd750a..957f0e8c2 100644
--- a/demos/SPC5/RT-SPC560B-EVB/main.c
+++ b/demos/SPC5/RT-SPC560B-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -153,7 +153,6 @@ static msg_t Thread1(void *arg) {
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
}
- return 0;
}
/*
@@ -190,7 +189,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC560D-EVB/main.c b/demos/SPC5/RT-SPC560D-EVB/main.c
index 044dd750a..957f0e8c2 100644
--- a/demos/SPC5/RT-SPC560D-EVB/main.c
+++ b/demos/SPC5/RT-SPC560D-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -153,7 +153,6 @@ static msg_t Thread1(void *arg) {
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
}
- return 0;
}
/*
@@ -190,7 +189,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC560P-EVB/main.c b/demos/SPC5/RT-SPC560P-EVB/main.c
index 9b401b0ec..1806961b2 100644
--- a/demos/SPC5/RT-SPC560P-EVB/main.c
+++ b/demos/SPC5/RT-SPC560P-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -153,7 +153,6 @@ static msg_t Thread1(void *arg) {
palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
}
- return 0;
}
/*
@@ -190,7 +189,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC563M-EVB/main.c b/demos/SPC5/RT-SPC563M-EVB/main.c
index a18dd1cee..ab881fdc4 100644
--- a/demos/SPC5/RT-SPC563M-EVB/main.c
+++ b/demos/SPC5/RT-SPC563M-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -136,7 +136,6 @@ static msg_t Thread1(void *arg) {
PAL_PORT_BIT(P11_LED1) | PAL_PORT_BIT(P11_LED2) |
PAL_PORT_BIT(P11_LED3) | PAL_PORT_BIT(P11_LED4));
}
- return 0;
}
/*
@@ -173,7 +172,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC564A-EVB/main.c b/demos/SPC5/RT-SPC564A-EVB/main.c
index a18dd1cee..ab881fdc4 100644
--- a/demos/SPC5/RT-SPC564A-EVB/main.c
+++ b/demos/SPC5/RT-SPC564A-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -136,7 +136,6 @@ static msg_t Thread1(void *arg) {
PAL_PORT_BIT(P11_LED1) | PAL_PORT_BIT(P11_LED2) |
PAL_PORT_BIT(P11_LED3) | PAL_PORT_BIT(P11_LED4));
}
- return 0;
}
/*
@@ -173,7 +172,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC56EC-EVB/main.c b/demos/SPC5/RT-SPC56EC-EVB/main.c
index 044dd750a..957f0e8c2 100644
--- a/demos/SPC5/RT-SPC56EC-EVB/main.c
+++ b/demos/SPC5/RT-SPC56EC-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -153,7 +153,6 @@ static msg_t Thread1(void *arg) {
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
}
- return 0;
}
/*
@@ -190,7 +189,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/SPC5/RT-SPC56EL-EVB/main.c b/demos/SPC5/RT-SPC56EL-EVB/main.c
index 9b401b0ec..1806961b2 100644
--- a/demos/SPC5/RT-SPC56EL-EVB/main.c
+++ b/demos/SPC5/RT-SPC56EL-EVB/main.c
@@ -90,12 +90,12 @@ static const ShellConfig shell_cfg1 = {
* 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) {
unsigned i;
for (i = 0; i < 4; i++) {
@@ -153,7 +153,6 @@ static msg_t Thread1(void *arg) {
palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
}
- return 0;
}
/*
@@ -190,7 +189,7 @@ int main(void) {
/*
* Normal main() thread activity.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/STM32/CMSIS-STM32F407-DISCOVERY/main.c b/demos/STM32/CMSIS-STM32F407-DISCOVERY/main.c
index 2ec461bb6..fbb365c80 100644
--- a/demos/STM32/CMSIS-STM32F407-DISCOVERY/main.c
+++ b/demos/STM32/CMSIS-STM32F407-DISCOVERY/main.c
@@ -25,7 +25,7 @@ static void Thread1(void const *arg) {
(void)arg;
- while (TRUE) {
+ while (true) {
palSetPad(GPIOD, GPIOD_LED3); /* Orange. */
osDelay(500);
palClearPad(GPIOD, GPIOD_LED3); /* Orange. */
@@ -67,7 +67,7 @@ int main(void) {
/* In the ChibiOS/RT CMSIS RTOS implementation the main() is an
usable thread, here we just sleep in a loop printing a message.*/
- while (TRUE) {
+ while (true) {
sdWrite(&SD2, (uint8_t *)"Hello World!\r\n", 14);
osDelay(500);
}
diff --git a/demos/STM32/RT-STM32F030R8-NUCLEO/main.c b/demos/STM32/RT-STM32F030R8-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32F030R8-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32F030R8-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F051-DISCOVERY/main.c b/demos/STM32/RT-STM32F051-DISCOVERY/main.c
index a2e6095ed..f3e18f96e 100644
--- a/demos/STM32/RT-STM32F051-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F051-DISCOVERY/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker1");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED4);
chThdSleepMilliseconds(500);
palSetPad(GPIOC, GPIOC_LED4);
@@ -42,7 +42,7 @@ static THD_FUNCTION(Thread2, arg) {
(void)arg;
chRegSetThreadName("blinker2");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED3);
chThdSleepMilliseconds(250);
palSetPad(GPIOC, GPIOC_LED3);
@@ -85,7 +85,7 @@ int main(void) {
* pressed the test procedure is launched with output on the serial
* driver 1.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F072-DISCOVERY/main.c b/demos/STM32/RT-STM32F072-DISCOVERY/main.c
index 4f6a22754..bd2cc1d25 100644
--- a/demos/STM32/RT-STM32F072-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F072-DISCOVERY/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker1");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED_BLUE);
chThdSleepMilliseconds(500);
palSetPad(GPIOC, GPIOC_LED_BLUE);
@@ -42,7 +42,7 @@ static THD_FUNCTION(Thread2, arg) {
(void)arg;
chRegSetThreadName("blinker2");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED_GREEN);
chThdSleepMilliseconds(250);
palSetPad(GPIOC, GPIOC_LED_GREEN);
@@ -85,7 +85,7 @@ int main(void) {
* pressed the test procedure is launched with output on the serial
* driver 1.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F100-DISCOVERY/main.c b/demos/STM32/RT-STM32F100-DISCOVERY/main.c
index 1ce8f73ab..f2afcea23 100644
--- a/demos/STM32/RT-STM32F100-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F100-DISCOVERY/main.c
@@ -84,7 +84,7 @@ int main(void) {
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F103-MAPLEMINI/main.c b/demos/STM32/RT-STM32F103-MAPLEMINI/main.c
index 545183c41..44eddabd1 100644
--- a/demos/STM32/RT-STM32F103-MAPLEMINI/main.c
+++ b/demos/STM32/RT-STM32F103-MAPLEMINI/main.c
@@ -143,7 +143,7 @@ static __attribute__((noreturn)) THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
systime_t time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500;
palClearPad(GPIOB, GPIOB_LED);
chThdSleepMilliseconds(time);
@@ -198,7 +198,7 @@ int __attribute__((noreturn)) 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/demos/STM32/RT-STM32F103-OLIMEX_STM32_P103/main.c b/demos/STM32/RT-STM32F103-OLIMEX_STM32_P103/main.c
index a363cf166..4b5d556e6 100644
--- a/demos/STM32/RT-STM32F103-OLIMEX_STM32_P103/main.c
+++ b/demos/STM32/RT-STM32F103-OLIMEX_STM32_P103/main.c
@@ -66,7 +66,7 @@ int main(void) {
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F103RB-NUCLEO/main.c b/demos/STM32/RT-STM32F103RB-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32F103RB-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32F103RB-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/main.c b/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/main.c
index ae3741d84..bce8983bb 100644
--- a/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/main.c
@@ -143,7 +143,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(GPIOA, GPIOA_LED_BLUE);
chThdSleepMilliseconds(time);
@@ -198,7 +198,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/demos/STM32/RT-STM32F303-DISCOVERY/main.c b/demos/STM32/RT-STM32F303-DISCOVERY/main.c
index ec9c1e502..d5ac58197 100644
--- a/demos/STM32/RT-STM32F303-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F303-DISCOVERY/main.c
@@ -110,7 +110,7 @@ int main(void) {
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F334R8-NUCLEO/main.c b/demos/STM32/RT-STM32F334R8-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32F334R8-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32F334R8-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c b/demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c
index 94039ddb2..256c6d763 100644
--- a/demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c
+++ b/demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c
@@ -27,7 +27,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(250);
palSetPad(GPIOC, GPIOC_LED1);
@@ -74,7 +74,7 @@ int main(void) {
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F401RE-NUCLEO/main.c b/demos/STM32/RT-STM32F401RE-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32F401RE-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32F401RE-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY-MEMS/main.c b/demos/STM32/RT-STM32F407-DISCOVERY-MEMS/main.c
index 640a8fc9d..5f102f6a8 100644
--- a/demos/STM32/RT-STM32F407-DISCOVERY-MEMS/main.c
+++ b/demos/STM32/RT-STM32F407-DISCOVERY-MEMS/main.c
@@ -166,7 +166,7 @@ static THD_FUNCTION(Thread1, arg) {
/* Reader thread loop.*/
time = chVTGetSystemTime();
- while (TRUE) {
+ while (true) {
int32_t x, y;
unsigned i;
@@ -306,7 +306,7 @@ int main(void) {
* Normal main() thread activity, in this demo it just performs
* a shell respawn upon its termination.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp) {
if (SDU1.config->usbp->state == USB_ACTIVE) {
/* Spawns a new shell.*/
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/main.c b/demos/STM32/RT-STM32F407-DISCOVERY/main.c
index e6930f4e8..1049ea7cc 100644
--- a/demos/STM32/RT-STM32F407-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/main.c
@@ -27,7 +27,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palSetPad(GPIOD, GPIOD_LED3); /* Orange. */
chThdSleepMilliseconds(500);
palClearPad(GPIOD, GPIOD_LED3); /* Orange. */
@@ -67,7 +67,7 @@ int main(void) {
* Normal main() thread activity, in this demo it just performs
* a shell respawn upon its termination.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/main.c b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/main.c
index b79169664..0e38e87a1 100644
--- a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/main.c
+++ b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/main.c
@@ -595,7 +595,7 @@ static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palTogglePad(GPIOC, GPIOC_LED);
chThdSleepMilliseconds(fs_ready ? 125 : 500);
}
@@ -680,7 +680,7 @@ int main(void) {
*/
chEvtRegister(&inserted_event, &el0, 0);
chEvtRegister(&removed_event, &el1, 1);
- while (TRUE) {
+ while (true) {
if (!shelltp && (SDU2.config->usbp->state == USB_ACTIVE))
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
diff --git a/demos/STM32/RT-STM32F411RE-NUCLEO/main.c b/demos/STM32/RT-STM32F411RE-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32F411RE-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32F411RE-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32F429-DISCOVERY/main.c b/demos/STM32/RT-STM32F429-DISCOVERY/main.c
index 3237e4d51..e0a371611 100644
--- a/demos/STM32/RT-STM32F429-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F429-DISCOVERY/main.c
@@ -31,7 +31,7 @@ static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker1");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOG, GPIOG_LED4_RED);
chThdSleepMilliseconds(500);
palSetPad(GPIOG, GPIOG_LED4_RED);
@@ -47,7 +47,7 @@ static msg_t Thread2(void *arg) {
(void)arg;
chRegSetThreadName("blinker2");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOG, GPIOG_LED3_GREEN);
chThdSleepMilliseconds(250);
palSetPad(GPIOG, GPIOG_LED3_GREEN);
@@ -181,7 +181,7 @@ int main(void) {
* Normal main() thread activity, in this demo it just performs
* a shell respawn upon its termination.
*/
- while (TRUE) {
+ while (true) {
if (!shelltp) {
if (SDU1.config->usbp->state == USB_ACTIVE) {
/* Spawns a new shell.*/
diff --git a/demos/STM32/RT-STM32L152-DISCOVERY/main.c b/demos/STM32/RT-STM32L152-DISCOVERY/main.c
index 800f3e822..86e1912cd 100644
--- a/demos/STM32/RT-STM32L152-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32L152-DISCOVERY/main.c
@@ -86,7 +86,7 @@ int main(void) {
* sleeping in a loop and check the button state, when the button is
* pressed the test procedure is launched.
*/
- while (TRUE) {
+ while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
diff --git a/demos/STM32/RT-STM32L152RE-NUCLEO/main.c b/demos/STM32/RT-STM32L152RE-NUCLEO/main.c
index 1ad4c7bc5..bd50f191d 100644
--- a/demos/STM32/RT-STM32L152RE-NUCLEO/main.c
+++ b/demos/STM32/RT-STM32L152RE-NUCLEO/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- while (TRUE) {
+ while (true) {
palClearPad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
palSetPad(GPIOA, GPIOA_LED_GREEN);
@@ -63,7 +63,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 (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
chThdSleepMilliseconds(500);
diff --git a/demos/various/RT-Win32-Simulator/main.c b/demos/various/RT-Win32-Simulator/main.c
index e391bf257..6540693e6 100644
--- a/demos/various/RT-Win32-Simulator/main.c
+++ b/demos/various/RT-Win32-Simulator/main.c
@@ -103,7 +103,7 @@ static const ShellConfig shell_cfg2 = {
* to the C printf() thread safe and the print operation atomic among threads.
* In this example the message is the zero terminated string itself.
*/
-static msg_t console_thread(void *arg) {
+static THD_FUNCTION(console_thread, arg) {
(void)arg;
while (!chThdShouldTerminateX()) {
@@ -112,7 +112,6 @@ static msg_t console_thread(void *arg) {
fflush(stdout);
chMsgRelease(tp, MSG_OK);
}
- return 0;
}
/**