diff options
Diffstat (limited to 'demos/nil/NIL-STM32F303-DISCOVERY/main.c')
-rw-r--r-- | demos/nil/NIL-STM32F303-DISCOVERY/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/demos/nil/NIL-STM32F303-DISCOVERY/main.c b/demos/nil/NIL-STM32F303-DISCOVERY/main.c index a6f22dc35..db842415f 100644 --- a/demos/nil/NIL-STM32F303-DISCOVERY/main.c +++ b/demos/nil/NIL-STM32F303-DISCOVERY/main.c @@ -19,6 +19,7 @@ #include "hal.h"
#include "nil.h"
+#include "ch_test.h"
/*
* Blinker thread #1.
@@ -92,9 +93,14 @@ THD_FUNCTION(Thread3, arg) { palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7)); /* USART1 TX. */
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7)); /* 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 (palReadPad(GPIOA, GPIOA_BUTTON))
+ test_execute((BaseSequentialStream *)&SD1);
+ chThdSleepMilliseconds(500);
}
}
@@ -105,7 +111,7 @@ 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(waThread3, "tester", Thread3, NULL)
THD_TABLE_END
/*
|