1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

nrf51822: error was not checked b/c of wrong signedness

This commit is contained in:
René Kijewski 2014-11-24 16:16:56 +01:00
parent 96fe9f012c
commit 7d7002305d

View File

@ -236,16 +236,14 @@ void gpio_irq_disable(gpio_t dev)
int gpio_read(gpio_t dev)
{
uint32_t pin;
int res = -1;
/* get pin */
pin = get_pin(dev);
int pin = get_pin(dev);
if (pin < 0) {
return pin;
}
/* read pin value depending if pin is input or output */
int res;
if (NRF_GPIO->DIR & (1 << pin)) {
res = (NRF_GPIO->OUT & (1 << pin));
}