SpenceKonde/megaTinyCore

ADCPowerOptions() ADC_ENABLE and ADC_DISABLE appear to be exchanged (re-open #1078)

Closed this issue · 2 comments

2dad406 does not fix #1078

The problem is that ADC_ENABLE disables the ADC and ADC_DISABLE enables it.

To make sense, the code in wiring_analog.c around line 419 requires that
ADC_ENABLE == _ADC_ENABLE_CTRL | _ADC_ENABLE_VAL

But this is not the case in Arduino.h around line 224.

  #define ADC_ENABLE        0x20
  #define ADC_DISABLE       0x30

There is also the same problem for the series-0 / series-1 code.

Sorry I am not in a position to retest at the moment - this is just inferred by code inspection.

I belive this has been corrected now with 5e3147b