gpio: unify assert checks for pin and interrupt configuration

gpio_pin_interrupt_configure() verified that the pin was within range,
while gpio_pin_configure() did not.  Make them consistent since they
take the same set of flags.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-10-02 11:40:28 -05:00 committed by Carles Cufí
commit 33cf10b5b8

View file

@ -660,6 +660,8 @@ static inline int gpio_pin_configure(struct device *port, u32_t pin,
(struct gpio_driver_data *)port->driver_data;
int ret;
__ASSERT(pin < GPIO_MAX_PINS_PER_PORT, "Invalid pin number");
__ASSERT((flags & (GPIO_PULL_UP | GPIO_PULL_DOWN)) !=
(GPIO_PULL_UP | GPIO_PULL_DOWN),
"Pull Up and Pull Down should not be enabled simultaneously");