代码风格更新以及加入超电的对接
This commit is contained in:
1 parent
957c535bda
commit
9de485e4ef
117 files changed
+9046
-6457
No files matched your search
@@ -1,33 +1,49 @@
|
||||
/* =============================================================================
|
||||
* referee_task.c - 裁判系统链路监测
|
||||
* 解析在 USART6 空闲中断完成(referee_parse_bytes 流式喂入),
|
||||
* 本任务仅做 100ms 周期的链路超时监测与心跳上报
|
||||
* ========================================================================== */
|
||||
/*
|
||||
*文件名称:referee_task.c
|
||||
*功能描述:裁判系统链路监测任务(100ms)
|
||||
*备注:数据解析在USART6空闲中断内由referee_parse_bytes完成,本任务仅做超时监测与心跳上报
|
||||
*/
|
||||
#include "app_tasks.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "bsp_usart.h"
|
||||
#include "referee.h"
|
||||
#include "robot_param.h"
|
||||
|
||||
/* referee_task:裁判系统链路监测
|
||||
* 解析在接收中断完成(referee_parse_bytes),本任务仅做超时监测与心跳 */
|
||||
|
||||
/*
|
||||
*函数简介:USART6裁判系统整帧接收回调
|
||||
*参数说明:frame:接收帧数据指针
|
||||
*参数说明:len:接收帧字节长度
|
||||
*返回类型:无
|
||||
*备注:将接收字节流喂入裁判系统解析状态机
|
||||
*/
|
||||
void referee_frame_callback(const uint8_t * frame, uint16_t len)
|
||||
{
|
||||
if (frame == NULL || len == 0U)
|
||||
return;
|
||||
|
||||
referee_parse_bytes(frame, len);
|
||||
}
|
||||
|
||||
/*
|
||||
*函数简介:裁判系统链路超时监测任务(100ms)
|
||||
*参数说明:argument:FreeRTOS任务参数(未使用)
|
||||
*返回类型:无
|
||||
*备注:无
|
||||
*/
|
||||
void referee_task(void const * argument)
|
||||
{
|
||||
(void)argument;
|
||||
|
||||
while (!app_ready)
|
||||
osDelay(2);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* 链路超时置断线 */
|
||||
if (referee.link_status &&
|
||||
HAL_GetTick() - referee.last_update_tick > DEVICE_OFFLINE_TIME_MS * 10)
|
||||
referee.link_status = 0;
|
||||
(HAL_GetTick() - referee.last_update_tick > DEVICE_OFFLINE_TIME_MS * 10U))
|
||||
{
|
||||
referee.link_status = 0U;//链路超时置断线
|
||||
}
|
||||
|
||||
monitor_heartbeat(HB_REFEREE);
|
||||
osDelay(100);
|
||||
|
||||
Reference in new issue
Block a user