mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
nrf51822: error was not checked b/c of wrong signedness
This commit is contained in:
parent
96fe9f012c
commit
7d7002305d
@ -236,16 +236,14 @@ void gpio_irq_disable(gpio_t dev)
|
|||||||
|
|
||||||
int gpio_read(gpio_t dev)
|
int gpio_read(gpio_t dev)
|
||||||
{
|
{
|
||||||
uint32_t pin;
|
|
||||||
int res = -1;
|
|
||||||
|
|
||||||
/* get pin */
|
/* get pin */
|
||||||
pin = get_pin(dev);
|
int pin = get_pin(dev);
|
||||||
if (pin < 0) {
|
if (pin < 0) {
|
||||||
return pin;
|
return pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read pin value depending if pin is input or output */
|
/* read pin value depending if pin is input or output */
|
||||||
|
int res;
|
||||||
if (NRF_GPIO->DIR & (1 << pin)) {
|
if (NRF_GPIO->DIR & (1 << pin)) {
|
||||||
res = (NRF_GPIO->OUT & (1 << pin));
|
res = (NRF_GPIO->OUT & (1 << pin));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user