From 7d7002305d04718589d85ff61de6be52191cdd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Mon, 24 Nov 2014 16:16:56 +0100 Subject: [PATCH] nrf51822: error was not checked b/c of wrong signedness --- cpu/nrf51822/periph/gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cpu/nrf51822/periph/gpio.c b/cpu/nrf51822/periph/gpio.c index 5c622e6fd1..1684c3c0e1 100644 --- a/cpu/nrf51822/periph/gpio.c +++ b/cpu/nrf51822/periph/gpio.c @@ -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)); }