From ed559de06336aa9a9dd71c1eb363e43d438a4e28 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 22 Dec 2016 14:50:52 +1100 Subject: [PATCH] stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init. --- stmhal/led.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/stmhal/led.c b/stmhal/led.c index 11784af533..399d4e729b 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -133,13 +133,7 @@ STATIC void led_pwm_init(int led) { const led_pwm_config_t *pwm_cfg = &led_pwm_config[led - 1]; // GPIO configuration - GPIO_InitTypeDef gpio_init; - gpio_init.Pin = led_pin->pin_mask; - gpio_init.Mode = GPIO_MODE_AF_PP; - gpio_init.Speed = GPIO_SPEED_FAST; - gpio_init.Pull = GPIO_NOPULL; - gpio_init.Alternate = pwm_cfg->alt_func; - HAL_GPIO_Init(led_pin->gpio, &gpio_init); + mp_hal_pin_config(led_pin, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, pwm_cfg->alt_func); // TIM configuration switch (pwm_cfg->tim_id) {