From a98f41994611fe5dc9e91f07fbfbf625b5ab0880 Mon Sep 17 00:00:00 2001 From: utzig Date: Sat, 26 Jul 2014 13:29:29 +0000 Subject: [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 --- demos/AVR/NIL-ARDUINOMEGA/main.c | 2 +- demos/AVR/NIL-ARDUINOMEGA/nilconf.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'demos/AVR') 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 /** @} */ -- cgit v1.2.3