Use 128rfa1 interrupts instead of timing.

Generalize DEBUGFLOW macro for use in multiple routines.
This commit is contained in:
David Kopf 2011-08-15 15:06:38 -04:00
parent b55dddcd38
commit 577215deca
4 changed files with 158 additions and 117 deletions

View file

@ -77,9 +77,18 @@
#define TIFR TIFR1
#endif
/* Track flow through rtimer interrupts*/
#if DEBUGFLOWSIZE&&0
extern uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE];
#define DEBUGFLOW(c) if (debugflowsize<(DEBUGFLOWSIZE-1)) debugflow[debugflowsize++]=c
#else
#define DEBUGFLOW(c)
#endif
/*---------------------------------------------------------------------------*/
#if defined(TCNT3) && RTIMER_ARCH_PRESCALER
ISR (TIMER3_COMPA_vect) {
DEBUGFLOW('/');
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* Disable rtimer interrupts */
@ -96,14 +105,17 @@ ISR (TIMER3_COMPA_vect) {
rtimer_run_next();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
DEBUGFLOW('\\');
}
#elif RTIMER_ARCH_PRESCALER
#warning "No Timer3 in rtimer-arch.c - using Timer1 instead"
ISR (TIMER1_COMPA_vect) {
DEBUGFLOW('/');
TIMSK &= ~((1<<TICIE1)|(1<<OCIE1A)|(1<<OCIE1B)|(1<<TOIE1));
rtimer_run_next();
DEBUGFLOW('\\');
}
#endif
@ -191,7 +203,7 @@ rtimer_arch_schedule(rtimer_clock_t t)
uint8_t sreg;
sreg = SREG;
cli ();
DEBUGFLOW(':');
#ifdef TCNT3
/* Set compare register */
OCR3A = t;