1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/saml1x: define CPU_COMMON_SAML1X symbol and use it

This commit is contained in:
Benjamin Valentin 2020-08-21 13:24:46 +02:00
parent 5d96151775
commit cc7f897cbc
5 changed files with 10 additions and 8 deletions

View File

@ -78,7 +78,7 @@ extern "C" {
#define CPU_IRQ_NUMOF PERIPH_COUNT_IRQn
#define CPU_FLASH_BASE FLASH_ADDR
#ifdef CPU_SAML1X
#ifdef CPU_COMMON_SAML1X
#define CPU_FLASH_RWWEE_BASE DATAFLASH_ADDR
#else
#define CPU_FLASH_RWWEE_BASE NVMCTRL_RWW_EEPROM_ADDR

View File

@ -49,7 +49,7 @@
/**
* @brief Number of external interrupt lines
*/
#ifdef CPU_SAML1X
#ifdef CPU_COMMON_SAML1X
#define NUMOF_IRQS (8U)
#else
#define NUMOF_IRQS (16U)
@ -231,7 +231,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
_EIC->CONFIG[exti >> 3].reg &= ~(0xf << ((exti & 0x7) * 4));
_EIC->CONFIG[exti >> 3].reg |= (flank << ((exti & 0x7) * 4));
/* enable the global EIC interrupt */
#ifdef CPU_SAML1X
#ifdef CPU_COMMON_SAML1X
/* EXTI[4..7] are binded to EIC_OTHER_IRQn */
NVIC_EnableIRQ((exti > 3 )? EIC_OTHER_IRQn : (EIC_0_IRQn + exti));
#elif defined(CPU_SAMD5X)
@ -339,7 +339,7 @@ void gpio_irq_disable(gpio_t pin)
_EIC->INTENCLR.reg = (1 << exti);
}
#if defined(CPU_SAML1X)
#if defined(CPU_COMMON_SAML1X)
void isr_eic_other(void)
#else
void isr_eic(void)
@ -360,7 +360,7 @@ void isr_eic(void)
cortexm_isr_end();
}
#if defined(CPU_SAML1X) || defined(CPU_SAMD5X)
#if defined(CPU_COMMON_SAML1X) || defined(CPU_SAMD5X)
#define ISR_EICn(n) \
void isr_eic ## n (void) \
@ -390,7 +390,7 @@ ISR_EICn(14)
ISR_EICn(15)
#endif /* NUMOF_IRQS > 8 */
#endif /* CPU_SAMD5X */
#endif /* CPU_SAML1X || CPU_SAMD5X */
#endif /* CPU_COMMON_SAML1X || CPU_SAMD5X */
#else /* MODULE_PERIPH_GPIO_IRQ */

View File

@ -45,7 +45,7 @@
#define BUSSTATE_OWNER SERCOM_I2CM_STATUS_BUSSTATE(2)
#define BUSSTATE_BUSY SERCOM_I2CM_STATUS_BUSSTATE(3)
#if defined(CPU_COMMON_SAML21) || defined(CPU_SAML1X) || defined(CPU_SAMD5X)
#if defined(CPU_COMMON_SAML21) || defined(CPU_COMMON_SAML1X) || defined(CPU_SAMD5X)
#define SERCOM_I2CM_CTRLA_MODE_I2C_MASTER SERCOM_I2CM_CTRLA_MODE(5)
#endif

View File

@ -32,7 +32,7 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#if defined (CPU_SAML1X) || defined (CPU_SAMD5X)
#if defined (CPU_COMMON_SAML1X) || defined (CPU_SAMD5X)
#define UART_HAS_TX_ISR
#endif

View File

@ -5,5 +5,7 @@ ifneq (,$(filter saml11%,$(CPU_MODEL)))
CFLAGS += -DCPU_SAML11
endif
CFLAGS += -DCPU_COMMON_SAML1X
include $(RIOTCPU)/sam0_common/Makefile.include
include $(RIOTMAKE)/arch/cortexm.inc.mk