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:
parent
fef3ebaa69
commit
33cf10b5b8
1 changed files with 2 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue