From 12a2f695cfb4de204b5114a958e31689f961b98c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 10 Feb 2014 13:29:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6695 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/nil/NIL-STM32F303-DISCOVERY/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'demos/nil') 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 /* -- cgit v1.2.3