diff options
-rw-r--r-- | demos/nil/NIL-STM32F303-DISCOVERY/main.c | 12 | ||||
-rw-r--r-- | test/nil/test_sequence_000.c | 2 |
2 files changed, 10 insertions, 4 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
/*
diff --git a/test/nil/test_sequence_000.c b/test/nil/test_sequence_000.c index 7b56a3908..a61ce4108 100644 --- a/test/nil/test_sequence_000.c +++ b/test/nil/test_sequence_000.c @@ -129,7 +129,7 @@ static void test_000_001_execute(void) { test_set_step(3);
{
time = chVTGetSystemTimeX();
- chThdSleepMicroseconds(100);
+ chThdSleepMilliseconds(100);
test_assert_time_window(time + MS2ST(100),
time + MS2ST(100) + 1,
"out of time window");
|