aboutsummaryrefslogtreecommitdiffstats
path: root/demos/SPC5/NIL-SPC560D-EVB
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-07-09 08:37:27 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-07-09 08:37:27 +0000
commita566fb49fa92386747554460043937509c12fa2a (patch)
tree243c0e55e0dbae7eb60430ba7666d3e3d15efa8f /demos/SPC5/NIL-SPC560D-EVB
parent5ff1c429f8fe1f530d4b19d5bacdd5c8cd2483b1 (diff)
downloadChibiOS-a566fb49fa92386747554460043937509c12fa2a.tar.gz
ChibiOS-a566fb49fa92386747554460043937509c12fa2a.tar.bz2
ChibiOS-a566fb49fa92386747554460043937509c12fa2a.zip
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
Diffstat (limited to 'demos/SPC5/NIL-SPC560D-EVB')
-rw-r--r--demos/SPC5/NIL-SPC560D-EVB/Makefile2
-rw-r--r--demos/SPC5/NIL-SPC560D-EVB/main.c32
-rw-r--r--demos/SPC5/NIL-SPC560D-EVB/nilconf.h2
3 files changed, 30 insertions, 6 deletions
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);
@@ -94,11 +92,37 @@ 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
/** @} */