Commit ed559de0 authored by Damien George's avatar Damien George
Browse files

stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init.

parent ffa30898
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment