mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-23 19:48:03 +08:00
[bsp][drv_gpio] fix the error code return when pin number is illegal
This commit is contained in:
@@ -212,7 +212,7 @@ rt_ssize_t tkm32_pin_read(rt_device_t dev, rt_base_t pin)
|
||||
index = get_pin(pin);
|
||||
if (index == RT_NULL)
|
||||
{
|
||||
return PIN_LOW;
|
||||
return -RT_EINVAL;
|
||||
}
|
||||
if (GPIO_ReadInputDataBit(index->gpio, index->pin) == Bit_RESET)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user