From 4b6ad3b99feedd16210f36b7c60e6f1cea6e24a7 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 1 Oct 2024 15:44:39 +0200 Subject: [PATCH] examples/lorawan: drop crazy STM32 hack We cannot just decrement the reference counter of power modes without any coordination. First, this will trigger an `assert()`ion on non STM32 MCUs that have power modes that are not used (the ref count would be decremented below zero). Second, there hopefully is a reason a certain power mode is blocked, e.g. because a periph driver needs a certain clock to function. Likely the `periph_uart` driver on STM32 boards keeps power modes blocked after TX is completed even when no RX callback is present, which is the waste of power this hack tries to address. But that should be addressed there. --- examples/lorawan/main.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/examples/lorawan/main.c b/examples/lorawan/main.c index cea9e38811..e02daab40b 100644 --- a/examples/lorawan/main.c +++ b/examples/lorawan/main.c @@ -131,16 +131,6 @@ int main(void) puts("LoRaWAN Class A low-power application"); puts("====================================="); - /* - * Enable deep sleep power mode (e.g. STOP mode on STM32) which - * in general provides RAM retention after wake-up. - */ -#if IS_USED(MODULE_PM_LAYERED) - for (unsigned i = 1; i < PM_NUM_MODES - 1; ++i) { - pm_unblock(i); - } -#endif - #ifdef USE_OTAA /* OTAA activation mode */ /* Convert identifiers and keys strings to byte arrays */ fmt_hex_bytes(deveui, CONFIG_LORAMAC_DEV_EUI_DEFAULT);