merge reseting counters when starting, from TimerRestartApproach
This commit is contained in:
commit
ef6c63b418
@ -126,9 +126,11 @@ void inverterStart(direction_t direction) {
|
|||||||
timerSupport[i].slotCnt = 0;
|
timerSupport[i].slotCnt = 0;
|
||||||
timerSupport[i].running = false;
|
timerSupport[i].running = false;
|
||||||
HAL_GPIO_WritePin(timerSupport[i].bridgePolarityPort, timerSupport[i].bridgePolarityPin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(timerSupport[i].bridgePolarityPort, timerSupport[i].bridgePolarityPin, GPIO_PIN_RESET);
|
||||||
|
__HAL_TIM_SET_COUNTER(timerSupport[i].handle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
timer1Cnt = 0;
|
timer1Cnt = 0;
|
||||||
|
__HAL_TIM_SET_COUNTER(&htim1, 0);
|
||||||
HAL_TIM_Base_Start_IT(&htim1);
|
HAL_TIM_Base_Start_IT(&htim1);
|
||||||
__HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE);
|
__HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user