Skip to content

Commit

Permalink
Update wiring_analog.c
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenceKonde committed Sep 25, 2023
1 parent 7c8ea27 commit b4e42ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ void DACReference(__attribute__ ((unused))uint8_t mode) {
}

int8_t getAnalogReadResolution() {
return ((ADC0.CTRLA & (ADC_RESSEL_gm)) == ADC_RESSEL_12BIT_gc) ? 12 : 10;
return ((ADC0.CTRLA & (ADC_RESSEL_bm)) == 1) ? 8 : 10;
}
int analogRead(uint8_t pin) {
check_valid_analog_pin(pin);
Expand Down

0 comments on commit b4e42ea

Please sign in to comment.