From 4986d60e615d3b2bd04a95ba1b3b8f8602df6ab4 Mon Sep 17 00:00:00 2001 From: Andreas Watterott <1488433+awatterott@users.noreply.github.com> Date: Wed, 18 Apr 2018 16:08:21 +0200 Subject: [PATCH] proper handling of ADMUXA + ADMUXB (ATtiny8x1) --- cores/arduino/wiring_analog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index 967c2b976..63167cac5 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -69,6 +69,9 @@ int analogRead(uint8_t pin) #else ADMUX = (analog_reference << 6) | (pin & 0x07); #endif +#elif defined(ADMUXA) + ADMUXA = (pin & 0x07); + ADMUXB = (analog_reference << 5); #endif // without a delay, we seem to read from the wrong channel