Skip to content

Commit 0d03a5b

Browse files
author
Richard Unger
committed
fix AVR compile errors
1 parent 44978cc commit 0d03a5b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/voltage/GenericVoltageSense.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ GenericVoltageSense::GenericVoltageSense(int pin, float fullScaleVoltage, float
1818

1919
bool GenericVoltageSense::init(int resolution){
2020
pinMode(pin, INPUT_ANALOG);
21+
#ifndef ARDUINO_ARCH_AVR
2122
if (resolution>0) {
2223
analogReadResolution(resolution);
23-
maxValue = powl(2, resolution);
24+
maxValue = pow(2, resolution);
2425
}
25-
else
26+
else {
2627
maxValue = pow(2, ADC_RESOLUTION);
28+
}
29+
#else
30+
maxValue = pow(2, ADC_RESOLUTION);
31+
#endif
2732
return true;
2833
};
2934

0 commit comments

Comments
 (0)