From 3ded26a700840ad56690f18054004df03b2ba6d2 Mon Sep 17 00:00:00 2001 From: nongxiaoming Date: Sat, 6 Jun 2020 17:20:36 +0800 Subject: [PATCH] [bsp][imxrt] fix the gpio drivers warning,'int_mode' may be used uninitialized. --- bsp/imxrt/libraries/drivers/drv_gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bsp/imxrt/libraries/drivers/drv_gpio.c b/bsp/imxrt/libraries/drivers/drv_gpio.c index 3701902829..ee1d2eb96b 100644 --- a/bsp/imxrt/libraries/drivers/drv_gpio.c +++ b/bsp/imxrt/libraries/drivers/drv_gpio.c @@ -559,6 +559,9 @@ static rt_err_t imxrt_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt case PIN_IRQ_MODE_LOW_LEVEL: int_mode = kGPIO_IntLowLevel; break; + default: + int_mode = kGPIO_IntRisingEdge; + break; } irq_index = (port << 1) + (pin_num >> 4); GPIO_PinSetInterruptConfig(mask_tab[port].gpio, pin_num, int_mode);