From a6b5f94ee0ba9e39db50c31e2462a7906590fab7 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 21 Apr 2022 12:03:34 +0200 Subject: [PATCH 1/2] pkg/openwsn: don't block IDLE mode (cherry picked from commit 237a44760a11aec30283c04982f0f7c9fb420d4a) --- pkg/openwsn/contrib/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/openwsn/contrib/board.c b/pkg/openwsn/contrib/board.c index 1d57838ac8c1..262a020c59f2 100644 --- a/pkg/openwsn/contrib/board.c +++ b/pkg/openwsn/contrib/board.c @@ -49,8 +49,8 @@ void board_init_openwsn(void) LOG_DEBUG("[openwsn/board]: init\n"); #ifdef MODULE_PM_LAYERED - /* sleeping is currently not supported, block all sleep modes */ - for (uint8_t i = 0; i < PM_NUM_MODES; i++) { + /* sleeping is currently not supported, block all sleep modes except IDLE */ + for (uint8_t i = 0; i < PM_NUM_MODES - 1; i++) { pm_block(i); } #endif From 43d6dc426281580105ea941d40b75ae4050937a4 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 21 Apr 2022 12:03:47 +0200 Subject: [PATCH 2/2] examples/lorawan: don't unblock IDLE mode This is already unblocked and will trigger an assertion. The code is still broken as other modes might be unblocked too, but at least it is just as broken as it was before #17895 (cherry picked from commit 520aa2d27d7df9fdc4f7ec0b73bda001f6159119) --- examples/lorawan/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lorawan/main.c b/examples/lorawan/main.c index 7bb6d0671c1b..ff7f99432ed5 100644 --- a/examples/lorawan/main.c +++ b/examples/lorawan/main.c @@ -154,7 +154,7 @@ int main(void) * in general provides RAM retention after wake-up. */ #if IS_USED(MODULE_PM_LAYERED) - for (unsigned i = 1; i < PM_NUM_MODES; ++i) { + for (unsigned i = 1; i < PM_NUM_MODES - 1; ++i) { pm_unblock(i); } #endif