r1upper/User/task/encodeCan.cpp
2025-04-26 17:45:08 +08:00

37 lines
730 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.

/**
* can发送与解码任务
*/
#include "TopDefine.h"
#include "userTask.h"
#include "encodeCan.hpp"
#include "djiMotor.h"
/**
* \brief can任务
*
* \param argument 未使用
*/
void FunctionCan(void *argument)
{
(void)argument; /* 未使用argument消除警告 */
//const uint32_t delay_tick = osKernelGetTickFreq() / TASK_FREQ_CAN;
djiInit();
//uint32_t tick = osKernelGetTickCount();
while(1)
{
#ifdef DEBUG
task_struct.stack_water_mark.can = osThreadGetStackSpace(osThreadGetId());
#endif
waitNewDji();
djiMotorEncode();
can2MotorEncode();
// tick += delay_tick; /* 计算下一个唤醒时刻 */
// osDelayUntil(tick);
}
}