From a566fb49fa92386747554460043937509c12fa2a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 9 Jul 2015 08:37:27 +0000 Subject: NIL e200z0 report. Added "volatile" to NIL system time variable. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8071 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/SPC5/NIL-SPC560D-EVB/Makefile | 2 +- demos/SPC5/NIL-SPC560D-EVB/main.c | 32 ++++++++++++++++++++++++++++---- demos/SPC5/NIL-SPC560D-EVB/nilconf.h | 2 +- 3 files changed, 30 insertions(+), 6 deletions(-) (limited to 'demos/SPC5/NIL-SPC560D-EVB') diff --git a/demos/SPC5/NIL-SPC560D-EVB/Makefile b/demos/SPC5/NIL-SPC560D-EVB/Makefile index 8d5ed1246..ae0cf9460 100644 --- a/demos/SPC5/NIL-SPC560D-EVB/Makefile +++ b/demos/SPC5/NIL-SPC560D-EVB/Makefile @@ -88,7 +88,7 @@ include $(CHIBIOS)/os/hal/ports/SPC5/SPC560Dxx/platform.mk include $(CHIBIOS)/os/hal/osal/nil/osal.mk include $(CHIBIOS)/os/nil/nil.mk include $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/mk/port_spc560dxx.mk -#include $(CHIBIOS)/test/nil/test.mk +include $(CHIBIOS)/test/nil/test.mk # Define linker script file here LDSCRIPT= $(PORTLD)/SPC560D40.ld diff --git a/demos/SPC5/NIL-SPC560D-EVB/main.c b/demos/SPC5/NIL-SPC560D-EVB/main.c index d24e0cec7..f730fcf62 100644 --- a/demos/SPC5/NIL-SPC560D-EVB/main.c +++ b/demos/SPC5/NIL-SPC560D-EVB/main.c @@ -16,7 +16,7 @@ #include "nil.h" #include "hal.h" -//#include "test.h" +#include "ch_test.h" /* * LEDs blinker thread, times are in milliseconds. @@ -34,8 +34,6 @@ static THD_FUNCTION(Thread1, arg) { while (true) { unsigned i; - chnWriteTimeout(&SD1, (uint8_t *)"Hello World!\r\n", 14, TIME_INFINITE); - for (i = 0; i < 4; i++) { palClearPad(PORT_E, PE_LED1); chThdSleepMilliseconds(100); @@ -93,12 +91,38 @@ static THD_FUNCTION(Thread1, arg) { } } +/* + * Tester thread. + */ +THD_WORKING_AREA(waThread2, 128); +THD_FUNCTION(Thread2, arg) { + + (void)arg; + + /* + * Activates the serial driver 1 using the driver default configuration. + */ + sdStart(&SD1, NULL); + + /* Welcome message.*/ + chnWriteTimeout(&SD1, (uint8_t *)"Hello World!\r\n", 14, TIME_INFINITE); + + /* Waiting for button push and activation of the test suite.*/ + while (true) { + if (palReadPad(PORT_E, PE_BUTTON1)) + test_execute((BaseSequentialStream *)&SD1); + chThdSleepMilliseconds(500); + } +} + /* * Threads static table, one entry per thread. The number of entries must * match NIL_CFG_NUM_THREADS. */ THD_TABLE_BEGIN - THD_TABLE_ENTRY(waThread1, "blinker", Thread1, NULL) +THD_TABLE_ENTRY(waThread1, "blinker", Thread1, NULL) +THD_TABLE_ENTRY(wa_test_support, "test_support", test_support, (void *)&nil.threads[2]) +THD_TABLE_ENTRY(waThread2, "tester", Thread2, NULL) THD_TABLE_END /* diff --git a/demos/SPC5/NIL-SPC560D-EVB/nilconf.h b/demos/SPC5/NIL-SPC560D-EVB/nilconf.h index 6718e19ff..356667177 100644 --- a/demos/SPC5/NIL-SPC560D-EVB/nilconf.h +++ b/demos/SPC5/NIL-SPC560D-EVB/nilconf.h @@ -40,7 +40,7 @@ * @note This number is not inclusive of the idle thread which is * Implicitly handled. */ -#define NIL_CFG_NUM_THREADS 1 +#define NIL_CFG_NUM_THREADS 3 /** @} */ -- cgit v1.2.3