Skip to content

Commit 5a5e8d4

Browse files
committed
#166 avoid small memory leak creating dfrobot abstraction
1 parent 8975b99 commit 5a5e8d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DfRobotInputAbstraction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ const PROGMEM DfRobotAnalogRanges dfRobotV1AvrRanges { 0.0488F, 0.1904F, 0.3710F
129129

130130

131131
inline IoAbstractionRef inputFromDfRobotShield(uint8_t pin = A0, AnalogDevice* device = nullptr) {
132-
device = new ArduinoAnalogDevice();
132+
device = internalAnalogIo();
133133
return new DfRobotInputAbstraction(&dfRobotAvrRanges, pin, device);
134134
}
135135

136136
inline IoAbstractionRef inputFromDfRobotShieldV1(uint8_t pin = A0, AnalogDevice* device = nullptr) {
137-
device = new ArduinoAnalogDevice();
137+
device = internalAnalogIo();
138138
return new DfRobotInputAbstraction(&dfRobotV1AvrRanges, pin, device);
139139
}
140140

0 commit comments

Comments
 (0)