mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-27 15:24:11 +08:00
[bsp][drv_gpio] fix the error code return when pin number is illegal
This commit is contained in:
@@ -147,6 +147,10 @@ static rt_ssize_t ft32_pin_read(rt_device_t dev, rt_base_t pin)
|
||||
gpio_pin = PIN_FTPIN(pin);
|
||||
value = GPIO_ReadInputDataBit(gpio_port, gpio_pin);
|
||||
}
|
||||
else
|
||||
{
|
||||
return -RT_EINVAL;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user