Skip to content

Commit

Permalink
fixup! cpu/gd32v: add periph_gpio_irq support
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jan 23, 2023
1 parent ab3467d commit fde09cc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cpu/gd32v/periph/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<n> shares
* the EXTI line with PB<n>, PC<n>, PD<n> and PE<n>. */
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

Expand Down

0 comments on commit fde09cc

Please sign in to comment.