修复裁判系统解析未定义的问题
This commit is contained in:
parent
6d4a0cb148
commit
a235aec5df
|
@ -15,28 +15,13 @@ static referee_info_t referee_info;
|
|||
static uint8_t Judge_Self_ID; // 当前机器人的ID
|
||||
static uint16_t Judge_SelfClient_ID; // 发送者机器人对应的客户端ID
|
||||
|
||||
static void RefereeRxCallback()
|
||||
{
|
||||
JudgeReadData(referee_usart_instance->recv_buff);
|
||||
}
|
||||
|
||||
referee_info_t *RefereeInit(UART_HandleTypeDef *referee_usart_handle)
|
||||
{
|
||||
USART_Init_Config_s conf;
|
||||
conf.module_callback = RefereeRxCallback;
|
||||
conf.usart_handle = referee_usart_handle;
|
||||
conf.recv_buff_size = RE_RX_BUFFER_SIZE;
|
||||
referee_usart_instance = USARTRegister(&conf);
|
||||
return &referee_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 读取裁判数据,中断中读取保证速度
|
||||
* @param 缓存数据
|
||||
* @retval 是否对正误判断做处理
|
||||
* @attention 在此判断帧头和CRC校验,无误再写入数据,不重复判断帧头
|
||||
*/
|
||||
void JudgeReadData(uint8_t *ReadFromUsart)
|
||||
static void JudgeReadData(uint8_t *ReadFromUsart)
|
||||
{
|
||||
uint16_t judge_length; // 统计一帧数据长度
|
||||
// referee_info.CmdID = 0; //数据命令码解析
|
||||
|
@ -121,4 +106,23 @@ void JudgeReadData(uint8_t *ReadFromUsart)
|
|||
JudgeReadData(ReadFromUsart + sizeof(xFrameHeader) + LEN_CMDID + referee_info.FrameHeader.DataLength + LEN_TAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 裁判系统串口接收回调函数,解析数据
|
||||
*
|
||||
*/
|
||||
static void RefereeRxCallback()
|
||||
{
|
||||
JudgeReadData(referee_usart_instance->recv_buff);
|
||||
}
|
||||
|
||||
referee_info_t *RefereeInit(UART_HandleTypeDef *referee_usart_handle)
|
||||
{
|
||||
USART_Init_Config_s conf;
|
||||
conf.module_callback = RefereeRxCallback;
|
||||
conf.usart_handle = referee_usart_handle;
|
||||
conf.recv_buff_size = RE_RX_BUFFER_SIZE;
|
||||
referee_usart_instance = USARTRegister(&conf);
|
||||
return &referee_info;
|
||||
}
|
|
@ -344,7 +344,7 @@ typedef struct
|
|||
#pragma pack()
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* @brief 初始化裁判系统,返回接收数据指针
|
||||
*
|
||||
* @param referee_usart_handle
|
||||
* @return referee_info_t*
|
||||
|
|
Loading…
Reference in New Issue