Fixes for platform timer code

Some platforms are missing timer channels, this is now left to the
(missing) preprocessor definitions on those platforms, no
platform-specific defines needed anymore.
Also fix usage of timer counter register 3 (hardcoded) in
cpu/avr/dev/clock.c -- this code isn't used on many platforms as it
requires a very special quartz clock frequency but this now also uses
the platform timer specification.
This commit is contained in:
Ralf Schlatterbeck 2014-06-26 18:00:30 +02:00
parent e65dabb119
commit b6e20bf6c0
3 changed files with 36 additions and 23 deletions

View file

@ -50,27 +50,6 @@
#include "sys/rtimer.h"
#include "rtimer-arch.h"
#if defined(__AVR_ATmega1284P__)
//Has no 'C', so we just set it to B. The code doesn't really use C so this
//is safe to do but lets it compile. Probably should enable the warning if
//it is ever used on other platforms.
//#warning no OCIE3C in timer3 architecture, hopefully it won't be needed!
#define OCIE3C OCIE3B
#define OCF3C OCF3B
#define PLAT_TCCRC PLAT_TCCRB
#endif
#if defined(__AVR_ATmega1281__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega128RFA1__)
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega644__)
//Has no 'C', so we just set it to B. The code doesn't really use C so this
//is safe to do but lets it compile.
#define OCIE1C OCIE1B
#define OCF1C OCF1B
#define PLAT_TCCRC PLAT_TCCRB
#endif
/* Track flow through rtimer interrupts*/
#if DEBUGFLOWSIZE&&0
extern uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE];