|
|
@@ -895,14 +895,19 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) |
|
|
|
// TIM2中断:负责段切换逻辑 |
|
|
|
if(htim->Instance == TIM2) |
|
|
|
{ |
|
|
|
if(g_plsr_route.current_section_num >= g_plsr_route.section_num && |
|
|
|
g_plsr_route.current_part != PLSR_PART_1 && |
|
|
|
g_plsr_route.run_state == PLSR_STATE_DECEL) |
|
|
|
// if(g_plsr_route.current_section_num >= g_plsr_route.section_num && |
|
|
|
// g_plsr_route.current_part != PLSR_PART_1 && |
|
|
|
// g_plsr_route.run_state == PLSR_STATE_DECEL) |
|
|
|
// { |
|
|
|
// PLSR_Route_PWM_Stop(); |
|
|
|
// } |
|
|
|
// else PLSR_Section_PWM_Stop(); |
|
|
|
PLSR_Route_PWM_Stop(); |
|
|
|
if(g_plsr_route.part1_target_freq == g_plsr_route.section[g_plsr_route.current_section_num - 1].target_freq |
|
|
|
&& g_plsr_route.current_part == 1) |
|
|
|
{ |
|
|
|
PLSR_Route_PWM_Stop(); |
|
|
|
g_plsr_route.current_freq = g_plsr_route.target_freq; |
|
|
|
} |
|
|
|
else PLSR_Section_PWM_Stop(); |
|
|
|
// PLSR_Route_PWM_Stop(); |
|
|
|
// 精确累加当前段已发送的脉冲数 |
|
|
|
int32_t current_section_pulses = __HAL_TIM_GetAutoreload(&htim2); |
|
|
|
if(g_plsr_mod_flag == 1) |
|
|
|