shoot/User/task/ball_task.c

30 lines
734 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "ball_task.h"
#include "TopDefine.h"
#include "FreeRTOS.h"
#include "attrTask.h"
#include <cmsis_os2.h>
#include "remote_control.h"
#include "ball.h"
extern RC_mess_t RC_mess;
BASKETBALL basketball;
void Task_Ball(void *argument)
{
(void)argument; /* 未使用argument消除警告 */
const uint32_t delay_tick = osKernelGetTickFreq() / TASK_FREQ_CAN;
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计算 */
basketball.hand=0;
basketball.paw=0;
while(1)
{
handling_ball(basketball.hand, basketball.paw);
tick += delay_tick; /* 计算下一个唤醒时刻 */
osDelayUntil(tick); /* 运行结束,等待下一个周期唤醒 */
}
}