diff --git a/cpu/nrf5x_common/include/periph_cpu_common.h b/cpu/nrf5x_common/include/periph_cpu_common.h index d305624d65..38db22ec80 100644 --- a/cpu/nrf5x_common/include/periph_cpu_common.h +++ b/cpu/nrf5x_common/include/periph_cpu_common.h @@ -46,7 +46,7 @@ extern "C" { * * The port definition is used (and zeroed) to suppress compiler warnings */ -#ifdef CPU_MODEL_NRF52840XXAA +#if !defined(CPU_MODEL_NRF52832XXAA) && !defined(CPU_FAM_NRF51) #define GPIO_PIN(x,y) ((x << 5) | y) #else #define GPIO_PIN(x,y) ((x & 0) | y) diff --git a/cpu/nrf5x_common/periph/gpio.c b/cpu/nrf5x_common/periph/gpio.c index dc91a1241e..a838854a18 100644 --- a/cpu/nrf5x_common/periph/gpio.c +++ b/cpu/nrf5x_common/periph/gpio.c @@ -86,7 +86,7 @@ static inline NRF_GPIO_Type *port(gpio_t pin) */ static inline int pin_num(gpio_t pin) { -#ifdef CPU_MODEL_NRF52840XXAA +#if !defined(CPU_MODEL_NRF52832XXAA) && !defined(CPU_FAM_NRF51) return (pin & PIN_MASK); #else return (int)pin; @@ -184,7 +184,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank, /* configure the GPIOTE channel: set even mode, pin and active flank */ NRF_GPIOTE->CONFIG[_pin_index] = (GPIOTE_CONFIG_MODE_Event | (pin_num(pin) << GPIOTE_CONFIG_PSEL_Pos) | -#ifdef CPU_MODEL_NRF52840XXAA +#if !defined(CPU_MODEL_NRF52832XXAA) && !defined(CPU_FAM_NRF51) ((pin & PORT_BIT) << 8) | #endif (flank << GPIOTE_CONFIG_POLARITY_Pos)); diff --git a/cpu/nrf5x_common/periph/uart.c b/cpu/nrf5x_common/periph/uart.c index 9f798ccaff..e1778abeba 100644 --- a/cpu/nrf5x_common/periph/uart.c +++ b/cpu/nrf5x_common/periph/uart.c @@ -85,7 +85,7 @@ static inline NRF_UARTE_Type *dev(uart_t uart) */ static uart_isr_ctx_t isr_ctx; -#endif /* CPU_MODEL_NRF52840XXAA || CPU_MODEL_NRF52811XXAA */ +#endif /* !CPU_MODEL_NRF52832XXAA && !CPU_FAM_NRF51 */ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) { @@ -415,7 +415,7 @@ static inline void irq_handler(uart_t uart) cortexm_isr_end(); } -#endif /* CPU_MODEL_NRF52840XXAA || CPU_MODEL_NRF5211XXAA */ +#endif /* !CPU_MODEL_NRF52832XXAA && !CPU_FAM_NRF51 */ #ifdef UART_0_ISR void UART_0_ISR(void)