aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr/irq.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-04-28 20:04:32 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-04-28 21:26:42 -0400
commit4a8f9407b8148d017af567ce41f0d42aecbe9b05 (patch)
treee09b85c7bb3c5a05af6873c6b7ac2141c9850fd2 /src/avr/irq.h
parent46cf3ef1457d0ea63dc30ecd3f343af83e03b589 (diff)
downloadkutter-4a8f9407b8148d017af567ce41f0d42aecbe9b05.tar.gz
kutter-4a8f9407b8148d017af567ce41f0d42aecbe9b05.tar.xz
kutter-4a8f9407b8148d017af567ce41f0d42aecbe9b05.zip
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>
Diffstat (limited to 'src/avr/irq.h')
-rw-r--r--src/avr/irq.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/avr/irq.h b/src/avr/irq.h
index 349c4c43..63a1018b 100644
--- a/src/avr/irq.h
+++ b/src/avr/irq.h
@@ -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) {