aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/NIL-STM32F051-DISCOVERY/main.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-09-19 09:27:46 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-09-19 09:27:46 +0000
commitbdada7a07e4bb85a725498534ed395d033f328f4 (patch)
tree85b69342f113befade4d89e17055c3c5176a652a /demos/STM32/NIL-STM32F051-DISCOVERY/main.c
parentddd5260f0c2111e1e797c647da869ae8d2fe2158 (diff)
downloadChibiOS-bdada7a07e4bb85a725498534ed395d033f328f4.tar.gz
ChibiOS-bdada7a07e4bb85a725498534ed395d033f328f4.tar.bz2
ChibiOS-bdada7a07e4bb85a725498534ed395d033f328f4.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10637 35acf78f-673a-0410-8e92-d51de3d6d3f4
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
/*