Skip to content

Commit 0ad8a22

Browse files
committed
Use correct Wire instance depending on board
1 parent ea003e3 commit 0ad8a22

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/Board.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ bool Board::setReferenceVoltage(float voltage) {
299299
}
300300

301301
void Board::shutDownFuelGauge() {
302-
MAX1726Driver fuelGauge(&Wire);
302+
#if defined(ARDUINO_PORTENTA_C33)
303+
MAX1726Driver fuelGauge(&Wire3);
304+
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_GENERIC_STM32H747_M4)
305+
MAX1726Driver fuelGauge(&Wire1);
306+
#elif defined(ARDUINO_NICLA_VISION)
307+
MAX1726Driver fuelGauge(&Wire1);
308+
#else
309+
#error "The selected board is not supported by the Battery class."
310+
#endif
303311
fuelGauge.setOperationMode(FuelGaugeOperationMode::shutdown);
304312
}

0 commit comments

Comments
 (0)