diff --git a/src/fan_ctrl_pwm.c b/src/fan_ctrl_pwm.c index 30a8d2e..feb23c7 100644 --- a/src/fan_ctrl_pwm.c +++ b/src/fan_ctrl_pwm.c @@ -46,6 +46,7 @@ void fan_ctrl_pwm_enable(void) gpio_set(DCDC_PORT, DCDC_BYPASS_SWITCH_PIN); // Enable PWM output on the PWM GPIO + gpio_mode_setup(FAN_PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, FAN_PWM_PIN); gpio_set_af(FAN_PORT, GPIO_AF0, FAN_PWM_PIN); // start the PWM timer @@ -63,6 +64,7 @@ void fan_ctrl_pwm_disable(void) timer_disable_counter(TIM21); // configure the PWM GPIO as input so the fan runs full speed if powered + gpio_mode_setup(FAN_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, FAN_PWM_PIN); }