From fde09ccce7c5f8657cc3a4607811671c4f48c88e Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 23 Jan 2023 21:09:05 +0100 Subject: [PATCH] fixup! cpu/gd32v: add periph_gpio_irq support --- cpu/gd32v/periph/gpio.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cpu/gd32v/periph/gpio.c b/cpu/gd32v/periph/gpio.c index 29218a4e4f2e..5b53b95ee424 100644 --- a/cpu/gd32v/periph/gpio.c +++ b/cpu/gd32v/periph/gpio.c @@ -239,20 +239,15 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank, /* configure pin as input */ gpio_init(pin, mode); +#ifndef NDEBUG /* GD32V has 16 EXTI lines for GPIO interrupts, where all ports share * the same EXTI line for the same pin. That means the pin PA shares * the EXTI line with PB, PC, PD and PE. */ - if (exti_ctx[pin_num].cb != 0) { -#ifdef NDEBUG - LOG_ERROR("EXTI line for GPIO_PIN(%u, %u) is already used.\n", - port_num, pin_num); -#else + if ((exti_ctx[pin_num].cb != 0) && (exti_line_port[pin_num] != port_num)) { LOG_ERROR("EXTI line for GPIO_PIN(%u, %u) is used by GPIO_PIN(%u, %u).\n", port_num, pin_num, exti_line_port[pin_num], pin_num); -#endif assert(0); } -#ifndef NDEBUG exti_line_port[pin_num] = port_num; #endif