From bdada7a07e4bb85a725498534ed395d033f328f4 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 19 Sep 2017 09:27:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10637 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/STM32/NIL-STM32F051-DISCOVERY/chconf.h | 2 +- ...2F051-DISCOVERY (OpenOCD, Flash and Run).launch | 104 ++++++++++----------- demos/STM32/NIL-STM32F051-DISCOVERY/main.c | 13 ++- demos/STM32/NIL-STM32F303-DISCOVERY/main.c | 2 +- 4 files changed, 64 insertions(+), 57 deletions(-) (limited to 'demos') diff --git a/demos/STM32/NIL-STM32F051-DISCOVERY/chconf.h b/demos/STM32/NIL-STM32F051-DISCOVERY/chconf.h index ecf98ad30..0304f2e61 100644 --- a/demos/STM32/NIL-STM32F051-DISCOVERY/chconf.h +++ b/demos/STM32/NIL-STM32F051-DISCOVERY/chconf.h @@ -42,7 +42,7 @@ * @note This number is not inclusive of the idle thread which is * Implicitly handled. */ -#define CH_CFG_NUM_THREADS 3 +#define CH_CFG_NUM_THREADS 4 /** @} */ diff --git a/demos/STM32/NIL-STM32F051-DISCOVERY/debug/NIL-STM32F051-DISCOVERY (OpenOCD, Flash and Run).launch b/demos/STM32/NIL-STM32F051-DISCOVERY/debug/NIL-STM32F051-DISCOVERY (OpenOCD, Flash and Run).launch index 7fcd2196a..9d8289b67 100644 --- a/demos/STM32/NIL-STM32F051-DISCOVERY/debug/NIL-STM32F051-DISCOVERY (OpenOCD, Flash and Run).launch +++ b/demos/STM32/NIL-STM32F051-DISCOVERY/debug/NIL-STM32F051-DISCOVERY (OpenOCD, Flash and Run).launch @@ -1,52 +1,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 /* diff --git a/demos/STM32/NIL-STM32F303-DISCOVERY/main.c b/demos/STM32/NIL-STM32F303-DISCOVERY/main.c index 2e667c9f4..0916158c1 100644 --- a/demos/STM32/NIL-STM32F303-DISCOVERY/main.c +++ b/demos/STM32/NIL-STM32F303-DISCOVERY/main.c @@ -95,7 +95,7 @@ THD_FUNCTION(Thread3, arg) { /* Waiting for button push and activation of the test suite.*/ while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) + if (palReadLine(LINE_BUTTON)) test_execute((BaseSequentialStream *)&SD1); chThdSleepMilliseconds(500); } -- cgit v1.2.3