Refined the check wether the timer interrupt is enabled,

as per triffid's request.
This commit is contained in:
Markus Hitter 2010-10-05 13:18:59 +02:00
parent af53d2350e
commit 5e1ce4ec96
2 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,7 @@ void enqueue(TARGET *t) {
#endif
// fire up in case we're not running yet
if (TIMSK1 == 0)
if (timerInterruptIsEnabled() == 0)
next_move();
}

View File

@ -30,5 +30,6 @@ void delayMicrosecondsInterruptible(unsigned int us);
#define enableTimerInterrupt() do { TIMSK1 |= (1<<OCIE1A); } while (0)
#define disableTimerInterrupt() do { TIMSK1 &= ~(1<<OCIE1A); } while (0)
#define timerInterruptIsEnabled() (TIMSK1 & (1 << OCIE1A))
#endif /* _TIMER_H */