Skip to content

Commit

Permalink
Drivers: simplify logic in bq27220
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Oct 6, 2024
1 parent 65ce40a commit 80d3be6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/drivers/bq27220.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static bool bq27220_data_memory_check(
while(--timeout > 0) {
if(!bq27220_get_operation_status(handle, &operation_status)) {
FURI_LOG_W(TAG, "Failed to get operation status, retries left %lu", timeout);
} else if(operation_status.CFGUPDATE == true) {
} else if(operation_status.CFGUPDATE) {
break;
};
furi_delay_us(BQ27220_TIMEOUT_CYCLE_INTERVAL_US);
Expand Down Expand Up @@ -302,7 +302,7 @@ bool bq27220_init(FuriHalI2cBusHandle* handle, const BQ27220DMData* data_memory)
FURI_LOG_E(TAG, "Failed to get operation status");
break;
}
if(operation_status.INITCOMP != true || operation_status.CFGUPDATE == true) {
if(!operation_status.INITCOMP || operation_status.CFGUPDATE) {
FURI_LOG_E(TAG, "Incorrect state, reset needed");
reset_and_provisioning_required = true;
}
Expand Down

0 comments on commit 80d3be6

Please sign in to comment.