remove while1 from task

This commit is contained in:
sdes1
2026-01-13 18:47:41 +01:00
parent e242231814
commit 47f75e5b40

View File

@@ -33,25 +33,23 @@ extern int16_t pidValue;
void timer_Task(void *pdata) {
timer_Init();
while(1){
if(pidValue){
uint16_t interval = 1.337*(64000/abs(pidValue));
uint8_t direction = pidValue<0;
//UCOS_Printf("%d %d\r\n", direction, interval);
//UCOS_Printf("counter value: %d\r\n", XTtcPs_GetCounterValue(&xttcps));
timer_Stop(0);
timer_Stop(1);
timer_Set_Interval_Length(0,interval);
timer_Set_Interval_Length(1,interval);
timer_Start(0);
timer_Start(1);
motor_Set_Moving_Direction(54, direction);
motor_Set_Moving_Direction(55, !direction);
}
else
{
timer_Stop(0);
}
if(pidValue){
uint16_t interval = 1.337*(64000/abs(pidValue));
uint8_t direction = pidValue<0;
//UCOS_Printf("%d %d\r\n", direction, interval);
//UCOS_Printf("counter value: %d\r\n", XTtcPs_GetCounterValue(&xttcps));
timer_Stop(0);
timer_Stop(1);
timer_Set_Interval_Length(0,interval);
timer_Set_Interval_Length(1,interval);
timer_Start(0);
timer_Start(1);
motor_Set_Moving_Direction(54, direction);
motor_Set_Moving_Direction(55, !direction);
}
else
{
timer_Stop(0);
}
}