From f6ba7ee106ab85b903d8990bd0256876cfda718f Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Wed, 22 May 2019 17:04:27 +0200 Subject: [PATCH 1/3] sam0: correct number of PM for SAML10 --- cpu/sam0_common/include/periph_cpu_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/sam0_common/include/periph_cpu_common.h b/cpu/sam0_common/include/periph_cpu_common.h index 215ff32e1cb2..ac3fe8edd003 100644 --- a/cpu/sam0_common/include/periph_cpu_common.h +++ b/cpu/sam0_common/include/periph_cpu_common.h @@ -98,7 +98,7 @@ enum { * @name Power mode configuration * @{ */ -#ifdef CPU_FAM_SAML11 +#ifdef CPU_SAML1X #define PM_NUM_MODES (2) #else #define PM_NUM_MODES (3) From aba9405dd40c984d8f52f781d90df50e7dd01e17 Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Wed, 22 May 2019 17:04:55 +0200 Subject: [PATCH 2/3] saml1x: enable use for pm_layered --- cpu/saml1x/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/saml1x/Makefile.include b/cpu/saml1x/Makefile.include index 9da8c0ba5dbf..2342d0fc2d8a 100644 --- a/cpu/saml1x/Makefile.include +++ b/cpu/saml1x/Makefile.include @@ -1,4 +1,6 @@ export CPU_ARCH = cortex-m23 +USEMODULE += pm_layered + include $(RIOTCPU)/sam0_common/Makefile.include include $(RIOTMAKE)/arch/cortexm.inc.mk From 0da43ba4eef69ff9625aef82ba3e9252981aa364 Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Fri, 24 May 2019 10:12:15 +0200 Subject: [PATCH 3/3] cpu/saml1x: set custom PM_BLOCKER_INITIAL --- cpu/saml1x/include/periph_cpu.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpu/saml1x/include/periph_cpu.h b/cpu/saml1x/include/periph_cpu.h index 1b3ab8337bb5..96a576d2c489 100644 --- a/cpu/saml1x/include/periph_cpu.h +++ b/cpu/saml1x/include/periph_cpu.h @@ -26,6 +26,12 @@ extern "C" { #endif +/** + * @brief Override the default initial PM blocker + * @todo Idle modes are enabled by default, deep sleep mode blocked + */ +#define PM_BLOCKER_INITIAL { .val_u32 = 0x00000001 } + /** * @brief Mapping of pins to EXTI lines, -1 means not EXTI possible */