From f624eb473a8bcd7f7875895f10f408a735790c63 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 19 Oct 2021 20:55:17 +0200 Subject: [PATCH] drivers/periph/gpio: state that interrupt callback must not be NULL This allows us to use `assert(cb != NULL)` inside `gpio_init_int()` and save a few cycles of interrupt latency. --- drivers/include/periph/gpio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/include/periph/gpio.h b/drivers/include/periph/gpio.h index 9743ab622d..ae78be931f 100644 --- a/drivers/include/periph/gpio.h +++ b/drivers/include/periph/gpio.h @@ -182,6 +182,8 @@ int gpio_init(gpio_t pin, gpio_mode_t mode); * @note You have to add the module `periph_gpio_irq` to your project to * enable this function * + * @pre @p cb must not be NULL + * * @param[in] pin pin to initialize * @param[in] mode mode of the pin, see @c gpio_mode_t * @param[in] flank define the active flank(s)