Skip to content

Commit 80d3be6

Browse files
committed
Drivers: simplify logic in bq27220
1 parent 65ce40a commit 80d3be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/drivers/bq27220.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static bool bq27220_data_memory_check(
180180
while(--timeout > 0) {
181181
if(!bq27220_get_operation_status(handle, &operation_status)) {
182182
FURI_LOG_W(TAG, "Failed to get operation status, retries left %lu", timeout);
183-
} else if(operation_status.CFGUPDATE == true) {
183+
} else if(operation_status.CFGUPDATE) {
184184
break;
185185
};
186186
furi_delay_us(BQ27220_TIMEOUT_CYCLE_INTERVAL_US);
@@ -302,7 +302,7 @@ bool bq27220_init(FuriHalI2cBusHandle* handle, const BQ27220DMData* data_memory)
302302
FURI_LOG_E(TAG, "Failed to get operation status");
303303
break;
304304
}
305-
if(operation_status.INITCOMP != true || operation_status.CFGUPDATE == true) {
305+
if(!operation_status.INITCOMP || operation_status.CFGUPDATE) {
306306
FURI_LOG_E(TAG, "Incorrect state, reset needed");
307307
reset_and_provisioning_required = true;
308308
}

0 commit comments

Comments
 (0)