diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-22 14:50:21 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-22 14:55:26 +1100 |
commit | ffa30898cc1eb348cec78402d8112c84c7e78404 (patch) | |
tree | 7fc10bf3bd9283f89c40dc476f295489fe1e8bc5 | |
parent | 425150040c7a37cb55da1d22c7b62e0510097d90 (diff) | |
download | micropython-ffa30898cc1eb348cec78402d8112c84c7e78404.tar.gz micropython-ffa30898cc1eb348cec78402d8112c84c7e78404.zip |
stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
-rw-r--r-- | stmhal/usrsw.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c index c9b7690bf9..1e07a55340 100644 --- a/stmhal/usrsw.c +++ b/stmhal/usrsw.c @@ -54,13 +54,7 @@ // this function inits the switch GPIO so that it can be used void switch_init0(void) { - mp_hal_gpio_clock_enable(MICROPY_HW_USRSW_PIN.gpio); - GPIO_InitTypeDef init; - init.Pin = MICROPY_HW_USRSW_PIN.pin_mask; - init.Mode = GPIO_MODE_INPUT; - init.Pull = MICROPY_HW_USRSW_PULL; - init.Speed = GPIO_SPEED_FAST; - HAL_GPIO_Init(MICROPY_HW_USRSW_PIN.gpio, &init); + mp_hal_pin_config(&MICROPY_HW_USRSW_PIN, MP_HAL_PIN_MODE_INPUT, MICROPY_HW_USRSW_PULL, 0); } int switch_get(void) { |