Skip to content

Commit 84b6645

Browse files
committed
Add logging to check which branch is executing
1 parent f3da8fb commit 84b6645

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/analogIO/Wippersnapper_AnalogIO.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ void Wippersnapper_AnalogIO::setADCResolution(int resolution) {
8787
analogReadResolution(16);
8888
_nativeResolution = 12;
8989
#elif defined(ARDUINO_ARCH_ESP32)
90-
scaleAnalogRead = true;
91-
_nativeResolution = 13;
90+
scaleAnalogRead = false; // handled in bsp
91+
_nativeResolution = 13; // S3 ADC is 13-bit, others are 12-bit
9292
#elif defined(ARDUINO_ARCH_RP2040)
9393
scaleAnalogRead = true;
9494
_nativeResolution = 10;
9595
#else
9696
scaleAnalogRead = true;
9797
_nativeResolution = 10;
9898
#endif
99-
10099
_adcResolution = resolution;
101100
}
102101

@@ -233,8 +232,10 @@ uint16_t Wippersnapper_AnalogIO::getPinValue(int pin) {
233232
/**********************************************************/
234233
float Wippersnapper_AnalogIO::getPinValueVolts(int pin) {
235234
#ifdef ARDUINO_ARCH_ESP32
235+
WS_DEBUG_PRINTLN("ESP32: Using analogReadMilliVolts()");
236236
return analogReadMilliVolts(pin) / 1000.0;
237237
#else
238+
WS_DEBUG_PRINTLN("Using old getPinValueVolts()");
238239
uint16_t rawValue = getPinValue(pin);
239240
return rawValue * getAref() / 65536;
240241
#endif

0 commit comments

Comments
 (0)