Skip to content

Commit 76a97fb

Browse files
Added return to function enterShipMode
I've added the code that actually checks if the value has been written and then returns its value to resolve this issue: "warning: no return statement in function returning non-void"
1 parent 64d42ff commit 76a97fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ bool nicla::enterShipMode()
100100
uint8_t status_reg = _pmic.getStatus();
101101
status_reg |= 0x20;
102102
_pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_STATUS, status_reg);
103+
if (_pmic.readByte(BQ25120A_ADDRESS, BQ25120A_STATUS) != status_reg) {
104+
return false;
105+
}
106+
return true;
103107
}
104108

105109
uint8_t nicla::readLDOreg()

0 commit comments

Comments
 (0)