shoot/User/task/nuc_task.c

50 lines
1.0 KiB
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 "nuc_task.h"
#include "nuc.h"
#include "TopDefine.h"//事件组的一些东西
#include "FreeRTOS.h"
#include "attrTask.h"
#include <cmsis_os2.h>
#ifdef DEBUG
NUC_t cmd_fromnuc;
#endif
void Task_nuc(void *argument)
{
(void)argument; /* 未使用argument消除警告 */
const uint32_t delay_tick = osKernelGetTickFreq() / TASK_FREQ_AI;
NUC_Init(&cmd_fromnuc);
uint32_t tick = osKernelGetTickCount();
while(1)
{
NUC_StartReceiving();
NUC_RawParse(&cmd_fromnuc);
// if(NUC_WaitDmaCplt())
// {
// NUC_RawParse(&cmd_fromnuc);
// }
// else
// {
// NUC_HandleOffline(&cmd_fromnuc);
// }
//消息队列的东西以后加
// osMessageQueueReset(task_runtime.msgq.cmd.raw.nuc);
// osMessageQueuePut(task_runtime.msgq.cmd.raw.nuc,&(cmd_fromnuc),0,0);
osDelay(2);
tick += delay_tick; /* 计算下一个唤醒时刄1ķ*/
osDelayUntil(tick);
}
}