mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/lorawan: move enabling of sleep modes to C code
This commit is contained in:
parent
11acdd0526
commit
ed9f740edd
@ -53,10 +53,6 @@ else ifeq (abp,$(ACTIVATION_MODE))
|
||||
CFLAGS += -DUSE_ABP
|
||||
endif
|
||||
|
||||
# Enable deep sleep power mode (e.g. STOP mode on STM32) which
|
||||
# in general provides RAM retention after wake-up.
|
||||
CFLAGS += -DPM_BLOCKER_INITIAL=0x00000001
|
||||
|
||||
# Comment this out to disable code in RIOT that does safety checking
|
||||
# which is not needed in a production environment but helps in the
|
||||
# development process:
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "thread.h"
|
||||
#include "fmt.h"
|
||||
|
||||
#include "periph/pm.h"
|
||||
#if IS_USED(MODULE_PERIPH_RTC)
|
||||
#include "periph/rtc.h"
|
||||
#else
|
||||
@ -148,6 +149,16 @@ 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; ++i) {
|
||||
pm_unblock(i);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize the radio driver */
|
||||
#if IS_USED(MODULE_SX127X)
|
||||
sx127x_setup(&sx127x, &sx127x_params[0], 0);
|
||||
|
Loading…
Reference in New Issue
Block a user