From eb766aa27f7f9d14c012c7cdde8a7932ed8dcdbd Mon Sep 17 00:00:00 2001 From: pmantoine Date: Wed, 12 Oct 2022 17:12:00 +0800 Subject: [PATCH] Fix to SAMD21 ADCee pin init --- DCCTimerSAMD.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DCCTimerSAMD.cpp b/DCCTimerSAMD.cpp index df11b1e..4c04276 100644 --- a/DCCTimerSAMD.cpp +++ b/DCCTimerSAMD.cpp @@ -164,12 +164,16 @@ int ADCee::init(uint8_t pin) { if (id > NUM_ADC_INPUTS) return -1023; - pinMode(pin, INPUT); +// pinMode(pin, INPUT); int value = analogRead(pin); if (analogvals == NULL) analogvals = (int *)calloc(NUM_ADC_INPUTS+1, sizeof(int)); analogvals[id] = value; usedpins |= (1<INPUTCTRL.bit.MUXPOS = g_APinDescription[pin].ulADCChannelNumber; // Selection for the positive ADC input return value; }