Skip to content

Commit c7f37fc

Browse files
authored
make gpio_acknowledge_irq inline (#2562)
1 parent e62cd02 commit c7f37fc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/rp2_common/hardware_gpio/gpio.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,6 @@ void gpio_set_dormant_irq_enabled(uint gpio, uint32_t events, bool enabled) {
253253
_gpio_set_irq_enabled(gpio, events, enabled, irq_ctrl_base);
254254
}
255255

256-
void gpio_acknowledge_irq(uint gpio, uint32_t events) {
257-
check_gpio_param(gpio);
258-
io_bank0_hw->intr[gpio / 8] = events << (4 * (gpio % 8));
259-
}
260-
261256
#define DEBUG_PIN_MASK (((1u << PICO_DEBUG_PIN_COUNT)-1) << PICO_DEBUG_PIN_BASE)
262257
void gpio_debug_pins_init(void) {
263258
gpio_init_mask(DEBUG_PIN_MASK);

src/rp2_common/hardware_gpio/include/hardware/gpio.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ static inline uint32_t gpio_get_irq_event_mask(uint gpio) {
570570
* \note For callbacks set with \ref gpio_set_irq_enabled_with_callback, or \ref gpio_set_irq_callback, this function is called automatically.
571571
* \param event_mask Bitmask of events to clear. See \ref gpio_irq_level for details.
572572
*/
573-
void gpio_acknowledge_irq(uint gpio, uint32_t event_mask);
573+
static inline void gpio_acknowledge_irq(uint gpio, uint32_t event_mask) {
574+
check_gpio_param(gpio);
575+
io_bank0_hw->intr[gpio / 8] = event_mask << (4 * (gpio % 8));
576+
}
574577

575578
/*! \brief Adds a raw GPIO IRQ handler for the specified GPIOs on the current core
576579
* \ingroup hardware_gpio

0 commit comments

Comments
 (0)