Refined the check wether the timer interrupt is enabled,
as per triffid's request.
This commit is contained in:
parent
af53d2350e
commit
5e1ce4ec96
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
1
timer.h
1
timer.h
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue