Skip to content

Commit e47ff70

Browse files
committed
Only end I2C when turning off power
1 parent c2161f5 commit e47ff70

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/Board.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,11 @@ void Board::setAllPeripheralsPower(bool on){
205205
this -> setCommunicationPeripheralsPower(on);
206206
this -> setExternalPowerEnabled(on);
207207
this -> setAnalogDigitalConverterPower(on);
208-
// I2C needs to be shut down because the PMIC would still try
209-
// to communicate with the MCU.
210-
Wire3.end();
208+
if(!on){
209+
// I2C needs to be shut down because the PMIC would still try
210+
// to communicate with the MCU.
211+
Wire3.end();
212+
}
211213
#else if defined(ARDUINO_PORTENTA_H7)
212214
// TODO Can we extract this into functions?
213215
if(on){

0 commit comments

Comments
 (0)