diff --git a/src/pwmout.c b/src/pwmout.c --- a/src/pwmout.c +++ b/src/pwmout.c @@ -92,42 +92,12 @@ void pwmout_process(int16_t duty) { HAL_GPIO_WritePin(SSR, 0); HAL_GPIO_WritePin(LED, 0); - // TODO: Disable timer } if(duty < 0) - duty = -duty; + duty = 0; htim17.Instance->CCR1 = duty; //duty; -// HAL_GPIO_TogglePin(SSR_GPIO_Port, SSR_PIN); - -// uint32_t ssr_output = duty; // meh -// -// // Kill SSR once the desired on-time has elapsed -// if(flash_getsettings()->val.control_mode == MODE_PID && ((HAL_GetTick() - last_ssr_on > ssr_output) || ssr_output <= 0)) -// { -// HAL_GPIO_WritePin(SSR, 0); -// HAL_GPIO_WritePin(LED, 0); -// } -// -// -// // Every 200ms, set the SSR on unless output is 0 -// if(flash_getsettings()->val.control_mode == MODE_PID && HAL_GetTick() - last_ssr_on > SSR_PERIOD) -// { -// // Heat or cool, if we need to -// if(ssr_output > 0) -// { -// HAL_GPIO_WritePin(SSR, 1); -// HAL_GPIO_WritePin(LED, 1); -// last_ssr_on = HAL_GetTick(); -// } -// else { -// // Make sure everything is off -// HAL_GPIO_WritePin(SSR, 0); -// HAL_GPIO_WritePin(LED, 0); -// } -// -// } } TIM_HandleTypeDef* pwmout_get_tim(void)