avr: Do not use Idle mode

The AVR chips (bizarrely) start an ADC conversion when entering Idle
mode.  This behavior can cause the ADC to be busy when a sample is
required.  Worse, if a series of events cause the cpu to enter and
leave Idle mode with a timing similar to the ADC checking rate then it
can cause the ADC to show as busy for extended periods.  This could
cause high MCU load and possibly lead to a "Rescheduled timer in the
past" shutdown.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-04-28 20:04:32 -04:00
parent 46cf3ef145
commit 4a8f9407b8
2 changed files with 1 additions and 9 deletions

View file

@ -29,7 +29,7 @@ static inline void irq_restore(irqstatus_t flag) {
}
static inline void irq_wait(void) {
asm("sei\n sleep\n cli" : : : "memory");
asm("sei\n nop\n cli" : : : "memory");
}
static inline void irq_poll(void) {