From 6e0219e4101623618be5ec92659d7b66d5889850 Mon Sep 17 00:00:00 2001 From: Mihai Renea Date: Wed, 11 Dec 2024 15:33:50 +0100 Subject: [PATCH] drivers/dose: fix poweroff --- drivers/dose/dose.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dose/dose.c b/drivers/dose/dose.c index ac80a0a48ca0..177c96f7cae1 100644 --- a/drivers/dose/dose.c +++ b/drivers/dose/dose.c @@ -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);