From 34086fc6c66f69f19ef233efbb7d63c18f34b2f7 Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Fri, 24 Oct 2014 14:36:06 -0400 Subject: [PATCH] cpu/cc2538 bug fix: OE (output enable) bit was set by gpio_init_in(). --- cpu/cc2538/periph/gpio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/cc2538/periph/gpio.c b/cpu/cc2538/periph/gpio.c index 2106b9a1cd..4b56a3519c 100644 --- a/cpu/cc2538/periph/gpio.c +++ b/cpu/cc2538/periph/gpio.c @@ -352,9 +352,9 @@ static const uint8_t reverse_pin_lut[] = { }; static const uint32_t ioc_mask_lut[] = { - [GPIO_NOPULL ] = IOC_OVERRIDE_OE, - [GPIO_PULLUP ] = IOC_OVERRIDE_OE | IOC_OVERRIDE_PUE, - [GPIO_PULLDOWN] = IOC_OVERRIDE_OE | IOC_OVERRIDE_PDE, + [GPIO_NOPULL ] = IOC_OVERRIDE_DIS, + [GPIO_PULLUP ] = IOC_OVERRIDE_PUE, + [GPIO_PULLDOWN] = IOC_OVERRIDE_PDE, }; int gpio_init_out(gpio_t dev, gpio_pp_t pushpull) @@ -370,7 +370,7 @@ int gpio_init_out(gpio_t dev, gpio_pp_t pushpull) gpio_dir_output(pin); /* configure the pin's pull resistor state */ - IOC_PXX_OVER[pin] = ioc_mask_lut[pushpull]; + IOC_PXX_OVER[pin] = IOC_OVERRIDE_OE | ioc_mask_lut[pushpull]; return 0; }