Skip to content

Commit 24dc014

Browse files
authored
Merge pull request RIOT-OS#21074 from derMihai/mir/fix_dose_poweroff
drivers/dose: fix poweroff
2 parents 775fd55 + 6e0219e commit 24dc014

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/dose/dose.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,10 @@ static void _poweroff(dose_t *ctx, dose_state_t sleep_state)
679679
return;
680680
}
681681

682-
wait_for_state(ctx, DOSE_STATE_IDLE);
682+
/* allow powering off without a state transition */
683+
if (ctx->state != DOSE_STATE_IDLE) {
684+
wait_for_state(ctx, DOSE_STATE_IDLE);
685+
}
683686

684687
if (gpio_is_valid(ctx->standby_pin)) {
685688
gpio_set(ctx->standby_pin);

0 commit comments

Comments
 (0)