From 9b13710e39c8b066cce912d82413052d5b6a7f6d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 23 Oct 2014 18:16:57 -0600 Subject: [PATCH] EFM32 port and pin decoding backward in every case. From Pierre-Noel Bouteville --- arch/arm/src/efm32/efm32_gpio.c | 12 ++++++------ arch/arm/src/efm32/efm32_gpioirq.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/efm32/efm32_gpio.c b/arch/arm/src/efm32/efm32_gpio.c index f5bf2ac7ac2..b44236154d4 100644 --- a/arch/arm/src/efm32/efm32_gpio.c +++ b/arch/arm/src/efm32/efm32_gpio.c @@ -293,9 +293,9 @@ int efm32_configgpio(gpio_pinset_t cfgset) /* Get basic pin configuration information */ - port = efm32_getpin(cfgset); + port = efm32_getport(cfgset); base = EFM32_GPIO_Pn_BASE(port); - pin = efm32_getport(cfgset); + pin = efm32_getpin(cfgset); mode = efm32_getmode(cfgset); /* Set the drive strength in the GPIO control register */ @@ -330,9 +330,9 @@ void efm32_gpiowrite(gpio_pinset_t pinset, bool value) /* Get basic pin configuration information */ - port = efm32_getpin(pinset); + port = efm32_getport(cfgset); base = EFM32_GPIO_Pn_BASE(port); - pin = efm32_getport(pinset); + pin = efm32_getpin(cfgset); /* And set the output value */ @@ -355,9 +355,9 @@ bool efm32_gpioread(gpio_pinset_t pinset) /* Get basic pin configuration information */ - port = efm32_getpin(pinset); + port = efm32_getport(cfgset); base = EFM32_GPIO_Pn_BASE(port); - pin = efm32_getport(pinset); + pin = efm32_getpin(cfgset); /* And return the input value of the pin */ diff --git a/arch/arm/src/efm32/efm32_gpioirq.c b/arch/arm/src/efm32/efm32_gpioirq.c index de86fc44a97..06d61595c58 100644 --- a/arch/arm/src/efm32/efm32_gpioirq.c +++ b/arch/arm/src/efm32/efm32_gpioirq.c @@ -201,8 +201,8 @@ void efm32_gpioirq(gpio_pinset_t pinset) /* Get basic pin configuration information */ - port = efm32_getpin(pinset); - pin = efm32_getport(pinset); + port = efm32_getport(pinset); + pin = efm32_getpin(pinset); bit = ((uint32_t)1 << pin); /* Make sure that the pin interrupt is disabled */