You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2021/04/12 15:17:06 UTC
[mynewt-core] branch master updated: kinetis/hal_gpio.c: Fix
hal_gpio_init_out, to make it set the pin to given initial value.
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 361d21a kinetis/hal_gpio.c: Fix hal_gpio_init_out, to make it set the pin to given initial value.
new 207b3bd Merge pull request #2542 from mlaz/kinetis_fixes
361d21a is described below
commit 361d21a9ed4abf29f3db6ab4c7bc8551d5a8a162
Author: Miguel Azevedo <mi...@gmail.com>
AuthorDate: Mon Mar 22 15:22:47 2021 +0000
kinetis/hal_gpio.c: Fix hal_gpio_init_out, to make it set the pin to given initial value.
---
hw/mcu/nxp/kinetis/src/hal_gpio.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/mcu/nxp/kinetis/src/hal_gpio.c b/hw/mcu/nxp/kinetis/src/hal_gpio.c
index e1d69e5..e328745 100644
--- a/hw/mcu/nxp/kinetis/src/hal_gpio.c
+++ b/hw/mcu/nxp/kinetis/src/hal_gpio.c
@@ -84,14 +84,13 @@ int
hal_gpio_init_out(int pin, int val)
{
gpio_pin_config_t gconfig;
- port_pin_config_t pconfig;
gconfig.pinDirection = kGPIO_DigitalOutput;
- pconfig.mux = kPORT_MuxAsGpio;
+ gconfig.outputLogic = (uint8_t) val;
CLOCK_EnableClock(s_portClocks[GPIO_PORT(pin)]);
- PORT_SetPinConfig(s_portBases[GPIO_PORT(pin)], GPIO_INDEX(pin), &pconfig);
GPIO_PinInit(s_gpioBases[GPIO_PORT(pin)], GPIO_INDEX(pin), &gconfig);
+ PORT_SetPinMux(s_portBases[GPIO_PORT(pin)], GPIO_INDEX(pin), kPORT_MuxAsGpio);
return 0;
}