From 76a97fbf8dd54507254682c28582b81b1608b980 Mon Sep 17 00:00:00 2001 From: Alessandro <66976091+alessandromrc@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:20:18 +0100 Subject: [PATCH] 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" --- libraries/Nicla_System/src/Nicla_System.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/Nicla_System/src/Nicla_System.cpp b/libraries/Nicla_System/src/Nicla_System.cpp index d01ab1d60..a1dcc5b0a 100644 --- a/libraries/Nicla_System/src/Nicla_System.cpp +++ b/libraries/Nicla_System/src/Nicla_System.cpp @@ -100,6 +100,10 @@ bool nicla::enterShipMode() uint8_t status_reg = _pmic.getStatus(); status_reg |= 0x20; _pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_STATUS, status_reg); + if (_pmic.readByte(BQ25120A_ADDRESS, BQ25120A_STATUS) != status_reg) { + return false; + } + return true; } uint8_t nicla::readLDOreg()