Skip to content

Commit 44978cc

Browse files
author
Richard Unger
committed
fix errors on different platforms
1 parent 8fb10f7 commit 44978cc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/voltage/GenericVoltageSense.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44

55

66

7-
GenericVoltageSense::GenericVoltageSense(int pin, float fullScaleVoltage, float gain, float offset, float Tf) : VoltageSense(gain, offset, Tf), pin(pin), fullScaleVoltage(fullScaleVoltage) {
7+
GenericVoltageSense::GenericVoltageSense(int pin, float fullScaleVoltage, float gain, float offset, float Tf) : VoltageSense(gain, offset, Tf), fullScaleVoltage(fullScaleVoltage), pin(pin) {
88
};
99

10+
#ifndef INPUT_ANALOG
11+
#define INPUT_ANALOG INPUT
12+
#endif
1013

14+
#ifndef ADC_RESOLUTION
15+
#define ADC_RESOLUTION 10
16+
#endif
1117

1218

1319
bool GenericVoltageSense::init(int resolution){
@@ -17,7 +23,8 @@ bool GenericVoltageSense::init(int resolution){
1723
maxValue = powl(2, resolution);
1824
}
1925
else
20-
maxValue = powl(2, ADC_RESOLUTION);
26+
maxValue = pow(2, ADC_RESOLUTION);
27+
return true;
2128
};
2229

2330

0 commit comments

Comments
 (0)