@@ -155,12 +155,12 @@ int NiclaSenseEnv::UARTBaudRate() {
155155bool NiclaSenseEnv::setUARTBaudRate (int baudRate, bool persist) {
156156 int baudRateIndex = baudRateNativeValue (baudRate);
157157 if (baudRateIndex == -1 ) {
158- return ; // Baud rate not found
158+ return false ; // Baud rate not found
159159 }
160160
161161 uint8_t uartControlRegisterData = readFromRegister<uint8_t >(UART_CONTROL_REGISTER_INFO);
162162 if ((uartControlRegisterData & 7 ) == baudRateIndex) {
163- return ; // Value is already the same
163+ return true ; // Value is already the same
164164 }
165165 if (!writeToRegister (UART_CONTROL_REGISTER_INFO, (uartControlRegisterData & ~7 ) | baudRateIndex)){
166166 return false ;
@@ -181,7 +181,7 @@ bool NiclaSenseEnv::isUARTCSVOutputEnabled() {
181181bool NiclaSenseEnv::setUARTCSVOutputEnabled (bool enabled, bool persist) {
182182 uint8_t boardControlRegisterData = readFromRegister<uint8_t >(CONTROL_REGISTER_INFO);
183183 if ((boardControlRegisterData & 2 ) == static_cast <int >(enabled)) {
184- return ; // Value is already the same
184+ return true ; // Value is already the same
185185 }
186186 if (!writeToRegister (CONTROL_REGISTER_INFO, (boardControlRegisterData & ~2 ) | (enabled << 1 ))){
187187 return false ;
@@ -202,15 +202,15 @@ char NiclaSenseEnv::CSVDelimiter() {
202202bool NiclaSenseEnv::setCSVDelimiter (char delimiter, bool persist) {
203203 char currentDelimiter = CSVDelimiter ();
204204 if (currentDelimiter == delimiter) {
205- return ; // Value is already the same
205+ return true ; // Value is already the same
206206 }
207207
208208 // Define prohibited delimiters
209209 const char prohibitedDelimiters[] = {' \r ' , ' \n ' , ' \\ ' , ' "' , ' \' ' };
210210
211211 for (auto prohibitedDelimiter : prohibitedDelimiters) {
212212 if (delimiter == prohibitedDelimiter) {
213- return ; // Delimiter is prohibited
213+ return false ; // Delimiter is prohibited
214214 }
215215 }
216216
@@ -234,7 +234,7 @@ bool NiclaSenseEnv::isDebuggingEnabled() {
234234bool NiclaSenseEnv::setDebuggingEnabled (bool enabled, bool persist) {
235235 uint8_t boardControlRegisterData = readFromRegister<uint8_t >(CONTROL_REGISTER_INFO);
236236 if ((boardControlRegisterData & 1 ) == static_cast <int >(enabled)) {
237- return ; // Value is already the same
237+ return true ; // Value is already the same
238238 }
239239 if (!writeToRegister (CONTROL_REGISTER_INFO, (boardControlRegisterData & ~1 ) | enabled)){
240240 return false ;
@@ -249,12 +249,12 @@ bool NiclaSenseEnv::setDebuggingEnabled(bool enabled, bool persist) {
249249
250250bool NiclaSenseEnv::setDeviceAddress (int address, bool persist) {
251251 if (address < 0 || address > 127 ) {
252- return ; // Invalid address
252+ return false ; // Invalid address
253253 }
254254 uint8_t addressRegisterData = readFromRegister<uint8_t >(SLAVE_ADDRESS_REGISTER_INFO);
255255 // Check bits 0 - 6
256256 if ((addressRegisterData & 127 ) == address) {
257- return ; // Value is already the same
257+ return true ; // Value is already the same
258258 }
259259 if (!writeToRegister (SLAVE_ADDRESS_REGISTER_INFO, (addressRegisterData & ~127 ) | address)){
260260 return false ;
0 commit comments