From 4a8f9407b8148d017af567ce41f0d42aecbe9b05 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 28 Apr 2018 20:04:32 -0400 Subject: 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 --- src/avr/main.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/avr/main.c') diff --git a/src/avr/main.c b/src/avr/main.c index 9737c2be..2655d307 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -52,14 +52,6 @@ prescaler_init(void) } DECL_INIT(prescaler_init); -// The "sleep" instruction should cause the processor to enter "idle mode" -void -sleep_init(void) -{ - SMCR = 0x01; -} -DECL_INIT(sleep_init); - // Optimized crc16_ccitt for the avr processor uint16_t crc16_ccitt(char *buf, uint8_t len) -- cgit v1.2.3-70-g09d2