From e189d085b00ffebbe78a9d5789b98d673d17af1d Mon Sep 17 00:00:00 2001 From: dylad Date: Sat, 23 Mar 2019 22:11:15 +0100 Subject: [PATCH] cpu/sam0: add support for SAMR34 MCU --- cpu/sam0_common/Makefile.include | 4 +++- cpu/saml21/include/periph_cpu.h | 2 +- cpu/saml21/periph/pm.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpu/sam0_common/Makefile.include b/cpu/sam0_common/Makefile.include index db1810e68b..085bccb5f5 100644 --- a/cpu/sam0_common/Makefile.include +++ b/cpu/sam0_common/Makefile.include @@ -2,7 +2,9 @@ CFLAGS += -DCPU_FAM_$(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_') # Set ROM and RAM lengths according to CPU model -ifneq (,$(filter samd21g18a samd21j18a saml21j18b saml21j18a samr21e18a samr21g18a samr30g18a,$(CPU_MODEL))) +ifneq (,$(filter samd21g18a samd21j18a saml21j18b saml21j18a samr21e18a \ + samr21g18a samr30g18a samr34j18b,$(CPU_MODEL))) + ROM_LEN ?= 0x40000 RAM_LEN ?= 0x8000 endif diff --git a/cpu/saml21/include/periph_cpu.h b/cpu/saml21/include/periph_cpu.h index 52f9a7c440..8edf55002e 100644 --- a/cpu/saml21/include/periph_cpu.h +++ b/cpu/saml21/include/periph_cpu.h @@ -53,7 +53,7 @@ static const int8_t exti_config[2][32] = { 0, 1, 2, 3, 4, 5, 6, 7, 12, 13, -1, 15, -1, -1, 10, 11}, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, -1, -1, -1, -1, 6, 7, -1, -1, -1, -1, -1, -1, 14, 15}, -#elif defined(CPU_MODEL_SAMR30G18A) +#elif defined(CPU_MODEL_SAMR30G18A) || defined(CPU_MODEL_SAMR34J18B) { 0, 1, -1, -1, 4, 5, 6, 7, -1, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, -1, 6, 7, 12, 13, -1, 15, 8, -1, 10, 11}, { 0, -1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, diff --git a/cpu/saml21/periph/pm.c b/cpu/saml21/periph/pm.c index 816c1703d6..671318eeae 100644 --- a/cpu/saml21/periph/pm.c +++ b/cpu/saml21/periph/pm.c @@ -41,7 +41,7 @@ void pm_set(unsigned mode) default: /* Falls through */ case 2: DEBUG("pm_set(): setting IDLE mode.\n"); -#ifdef CPU_MODEL_SAMR30G18A +#if defined(CPU_MODEL_SAMR30G18A) || defined(CPU_MODEL_SAMR34J18B) _mode = PM_SLEEPCFG_SLEEPMODE_IDLE; #else _mode = PM_SLEEPCFG_SLEEPMODE_IDLE2;