|
|
@@ -1531,7 +1531,6 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) |
|
|
|
// 等待时间计数器累加 |
|
|
|
s_wait_time_counter++; |
|
|
|
uint32_t current_tim2_count = __HAL_TIM_GET_COUNTER(&htim2); |
|
|
|
//printf("TIM2 CNT: %lu, Pulse Count: %lu\n", TIM2->CNT, AllPluse); |
|
|
|
|
|
|
|
// 计算当前段已发送的总脉冲数 |
|
|
|
int32_t current_pulse_count = AllPluse + current_tim2_count; |
|
|
@@ -2129,6 +2128,7 @@ void PLSR_TaskSectionSwitch(PLSR_RouteConfig_t* route) |
|
|
|
/* 如果当前段等待外部事件,检查是否有事件触发 */ |
|
|
|
if (PLSR_Wait_CheckExtEvent(route)) |
|
|
|
{ |
|
|
|
AllPluse += __HAL_TIM_GET_COUNTER(&htim2); // 累加当前段已发送的脉冲数 |
|
|
|
/* 外部事件满足,切换到下一段 */ |
|
|
|
PLSR_Section_SwitchNext(route, 0); // 外部事件触发,传入0 |
|
|
|
/* 启动新段,设置新的脉冲参数和频率 */ |
|
|
|