Skip to content

Commit

Permalink
drivers/dose: fix poweroff
Browse files Browse the repository at this point in the history
  • Loading branch information
derMihai committed Dec 11, 2024
1 parent c80058e commit 6e0219e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/dose/dose.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,10 @@ static void _poweroff(dose_t *ctx, dose_state_t sleep_state)
return;
}

wait_for_state(ctx, DOSE_STATE_IDLE);
/* allow powering off without a state transition */
if (ctx->state != DOSE_STATE_IDLE) {
wait_for_state(ctx, DOSE_STATE_IDLE);
}

if (gpio_is_valid(ctx->standby_pin)) {
gpio_set(ctx->standby_pin);
Expand Down

0 comments on commit 6e0219e

Please sign in to comment.