diff --git a/my_src/inverter.c b/my_src/inverter.c index 6a11a87..9d730f9 100644 --- a/my_src/inverter.c +++ b/my_src/inverter.c @@ -126,9 +126,11 @@ void inverterStart(direction_t direction) { timerSupport[i].slotCnt = 0; timerSupport[i].running = false; HAL_GPIO_WritePin(timerSupport[i].bridgePolarityPort, timerSupport[i].bridgePolarityPin, GPIO_PIN_RESET); + __HAL_TIM_SET_COUNTER(timerSupport[i].handle, 0); } timer1Cnt = 0; + __HAL_TIM_SET_COUNTER(&htim1, 0); HAL_TIM_Base_Start_IT(&htim1); __HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE); }