[bsp][drv_gpio] fix the error code return when pin number is illegal

This commit is contained in:
Meco Man
2024-03-24 09:18:25 +08:00
committed by Rbb666
parent 2549b82bd6
commit 6a9c42a19d
51 changed files with 161 additions and 92 deletions
+4
View File
@@ -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;
}