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

This commit is contained in:
Meco Man
2024-03-23 21:04:19 -04:00
committed by Rbb666
parent 2549b82bd6
commit 6a9c42a19d
51 changed files with 161 additions and 92 deletions

View File

@@ -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)
{