From d337834ba5d2e3b4a32c12567227c69a17fc4433 Mon Sep 17 00:00:00 2001 From: agdl Date: Tue, 28 May 2019 12:58:52 +0200 Subject: [PATCH] Added SAMPCAP flag to analogRead() --- cores/arduino/wiring_analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index c5a715b5..d59d1549 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -38,7 +38,7 @@ void analogReference(uint8_t mode) if((mode == EXTERNAL) || (mode == VDD)) { /* Set reference in ADC peripheral */ - ADC0.CTRLC |= mode; + ADC0.CTRLC |= mode | ADC_SAMPCAP_bm; /* If reference using internal reference from VREF */ } else if (