Skip to content

Commit d149870

Browse files
authored
Merge pull request #635 from alessandromrc/patch-2
Added return to function enterShipMode
2 parents 792c9f8 + 76a97fb commit d149870

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ bool nicla::enterShipMode()
108108
uint8_t status_reg = _pmic.getStatusRegister();
109109
status_reg |= 0x20;
110110
_pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_STATUS, status_reg);
111+
if (_pmic.readByte(BQ25120A_ADDRESS, BQ25120A_STATUS) != status_reg) {
112+
return false;
113+
}
114+
return true;
111115
}
112116

113117
bool nicla::enableCharging(uint16_t mA)

0 commit comments

Comments
 (0)