2025-03-12 23:04:18 +08:00
|
|
|
|
#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,消除警告 */
|
|
|
|
|
|
2025-03-13 19:23:24 +08:00
|
|
|
|
const uint32_t delay_tick = osKernelGetTickFreq() / TASK_FREQ_AI;
|
2025-03-12 23:04:18 +08:00
|
|
|
|
|
|
|
|
|
NUC_Init(&cmd_fromnuc);
|
|
|
|
|
|
2025-03-13 19:23:24 +08:00
|
|
|
|
uint32_t tick = osKernelGetTickCount();
|
2025-03-12 23:04:18 +08:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
2025-03-13 19:23:24 +08:00
|
|
|
|
tick += delay_tick; /* 计算下一个唤醒时刄1ķ*/
|
|
|
|
|
osDelayUntil(tick);
|
2025-03-12 23:04:18 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|