aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/NIL-STM32F051-DISCOVERY/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/STM32/NIL-STM32F051-DISCOVERY/main.c')
-rw-r--r--demos/STM32/NIL-STM32F051-DISCOVERY/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/demos/STM32/NIL-STM32F051-DISCOVERY/main.c b/demos/STM32/NIL-STM32F051-DISCOVERY/main.c
index 9c631e81d..800dd6bad 100644
--- a/demos/STM32/NIL-STM32F051-DISCOVERY/main.c
+++ b/demos/STM32/NIL-STM32F051-DISCOVERY/main.c
@@ -16,6 +16,7 @@
#include "hal.h"
#include "ch.h"
+#include "ch_test.h"
/*
* Thread 1.
@@ -65,9 +66,14 @@ THD_FUNCTION(Thread3, arg) {
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1)); /* USART1 TX. */
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(1)); /* USART1 RX. */
+ /* Welcome message.*/
+ chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
+
+ /* Waiting for button push and activation of the test suite.*/
while (true) {
- chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
- chThdSleepMilliseconds(2000);
+ if (palReadLine(LINE_BUTTON))
+ test_execute((BaseSequentialStream *)&SD1);
+ chThdSleepMilliseconds(500);
}
}
@@ -78,7 +84,8 @@ THD_FUNCTION(Thread3, arg) {
THD_TABLE_BEGIN
THD_TABLE_ENTRY(waThread1, "blinker1", Thread1, NULL)
THD_TABLE_ENTRY(waThread2, "blinker2", Thread2, NULL)
- THD_TABLE_ENTRY(waThread3, "hello", Thread3, NULL)
+ THD_TABLE_ENTRY(wa_test_support, "test_support", test_support, (void *)&nil.threads[3])
+ THD_TABLE_ENTRY(waThread3, "tester", Thread3, NULL)
THD_TABLE_END
/*