aboutsummaryrefslogtreecommitdiffstats
path: root/demos/AVR
diff options
context:
space:
mode:
authorTheodore Ateba <tf.ateba@gmail.com>2018-01-22 21:24:44 +0000
committerTheodore Ateba <tf.ateba@gmail.com>2018-01-22 21:24:44 +0000
commit789d91f0f59955ad4450a2c587ee62f17d473081 (patch)
tree8a376575f42326ec316c219a824b7e970a4480ff /demos/AVR
parent53044c14a465c3868e80f59eab0a4ea1dbdca1f8 (diff)
downloadChibiOS-789d91f0f59955ad4450a2c587ee62f17d473081.tar.gz
ChibiOS-789d91f0f59955ad4450a2c587ee62f17d473081.tar.bz2
ChibiOS-789d91f0f59955ad4450a2c587ee62f17d473081.zip
AVR: Modification of the NIL test suite to avoid freezing at run time.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11394 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/AVR')
-rw-r--r--demos/AVR/TEST-SUITE-NIL/chconf.h6
-rw-r--r--demos/AVR/TEST-SUITE-NIL/main.c19
2 files changed, 12 insertions, 13 deletions
diff --git a/demos/AVR/TEST-SUITE-NIL/chconf.h b/demos/AVR/TEST-SUITE-NIL/chconf.h
index 53da0c6ed..c9cc37069 100644
--- a/demos/AVR/TEST-SUITE-NIL/chconf.h
+++ b/demos/AVR/TEST-SUITE-NIL/chconf.h
@@ -43,7 +43,7 @@
* @note This number is not inclusive of the idle thread which is
* Implicitly handled.
*/
-#define CH_CFG_NUM_THREADS 2
+#define CH_CFG_NUM_THREADS 3
/** @} */
@@ -66,7 +66,7 @@
* option defines the maximum amount of time allowed for
* timeouts.
*/
-#define CH_CFG_ST_FREQUENCY 15624
+#define CH_CFG_ST_FREQUENCY 1000
/**
* @brief Time delta constant for the tick-less mode.
@@ -76,7 +76,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
-#define CH_CFG_ST_TIMEDELTA 2
+#define CH_CFG_ST_TIMEDELTA 0
/** @} */
diff --git a/demos/AVR/TEST-SUITE-NIL/main.c b/demos/AVR/TEST-SUITE-NIL/main.c
index bbd6e078f..a98e5029d 100644
--- a/demos/AVR/TEST-SUITE-NIL/main.c
+++ b/demos/AVR/TEST-SUITE-NIL/main.c
@@ -1,5 +1,5 @@
/*
- ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -39,16 +39,19 @@ THD_WORKING_AREA(waThread2, 128);
THD_FUNCTION(Thread2, arg) {
(void)arg;
+ bool runTestSuite = true;
/*
* Activates the serial driver 1 using the driver default configuration.
- * PA9 and PA10 are routed to USART1.
*/
sdStart(&SD1, NULL);
while (true) {
- chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
- chThdSleepMilliseconds(2000);
+ if (runTestSuite) {
+ test_execute((BaseSequentialStream *)&SD1, &nil_test_suite);
+ runTestSuite = false;
+ }
+ chThdSleepMilliseconds(500);
}
}
@@ -58,7 +61,8 @@ THD_FUNCTION(Thread2, arg) {
*/
THD_TABLE_BEGIN
THD_TABLE_ENTRY(waThread1, "blinker", Thread1, NULL)
- THD_TABLE_ENTRY(waThread2, "hello", Thread2, 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
/*
@@ -76,11 +80,6 @@ int main(void) {
halInit();
chSysInit();
- /*
- * Start the NIL test suite.
- */
- test_execute((BaseSequentialStream *)&SD1, &nil_test_suite);
-
/* This is now the idle thread loop, you may perform here a low priority
task but you must never try to sleep or wait in this loop. Note that
this tasks runs at the lowest priority level so any instruction added