aboutsummaryrefslogtreecommitdiffstats
path: root/demos/AVR/NIL-ARDUINOMEGA
diff options
context:
space:
mode:
authorutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-07-26 13:29:29 +0000
committerutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-07-26 13:29:29 +0000
commita98f41994611fe5dc9e91f07fbfbf625b5ab0880 (patch)
tree4b3867b0113b9e248cf72e0b41d290a6a2c41861 /demos/AVR/NIL-ARDUINOMEGA
parent2120bb8b4e0be9418b98c92ab2d42064bb8efe3c (diff)
downloadChibiOS-a98f41994611fe5dc9e91f07fbfbf625b5ab0880.tar.gz
ChibiOS-a98f41994611fe5dc9e91f07fbfbf625b5ab0880.tar.bz2
ChibiOS-a98f41994611fe5dc9e91f07fbfbf625b5ab0880.zip
[AVR] Use tickless mode in ArduinoMega NIL demo
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7103 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/AVR/NIL-ARDUINOMEGA')
-rw-r--r--demos/AVR/NIL-ARDUINOMEGA/main.c2
-rw-r--r--demos/AVR/NIL-ARDUINOMEGA/nilconf.h7
2 files changed, 6 insertions, 3 deletions
diff --git a/demos/AVR/NIL-ARDUINOMEGA/main.c b/demos/AVR/NIL-ARDUINOMEGA/main.c
index ef2751b14..5d07cee85 100644
--- a/demos/AVR/NIL-ARDUINOMEGA/main.c
+++ b/demos/AVR/NIL-ARDUINOMEGA/main.c
@@ -27,7 +27,7 @@ THD_FUNCTION(Thread1, arg) {
while (true) {
palTogglePad(IOPORT2, PORTB_LED1);
- chThdSleepMilliseconds(1000);
+ chThdSleepMilliseconds(500);
}
}
diff --git a/demos/AVR/NIL-ARDUINOMEGA/nilconf.h b/demos/AVR/NIL-ARDUINOMEGA/nilconf.h
index a7ab0039f..c2dbbc932 100644
--- a/demos/AVR/NIL-ARDUINOMEGA/nilconf.h
+++ b/demos/AVR/NIL-ARDUINOMEGA/nilconf.h
@@ -62,8 +62,11 @@
* @note This value together with the @p NIL_CFG_ST_RESOLUTION
* option defines the maximum amount of time allowed for
* timeouts.
+ * @note Currently the Timer is configured with a prescaler of
+ * 1024. Arduinos running at 16MHz will have a frequency
+ * of 16MHz/1024. This will provide a resolution of ~64uS.
*/
-#define NIL_CFG_ST_FREQUENCY 1000
+#define NIL_CFG_ST_FREQUENCY 15624
/**
* @brief Time delta constant for the tick-less mode.
@@ -73,7 +76,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
-#define NIL_CFG_ST_TIMEDELTA 0
+#define NIL_CFG_ST_TIMEDELTA 2
/** @} */