mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 11:37:45 +08:00
一致UI初始化至chassis,添加id自动判断
This commit is contained in:
@@ -16,18 +16,21 @@
|
||||
#include "referee_def.h"
|
||||
#include "bsp_usart.h"
|
||||
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define JUDGE_DATA_ERROR 0
|
||||
#define JUDGE_DATA_CORRECT 1
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
// 裁判系统接收数据整合进一个结构体
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Robot_Color; //机器人颜色
|
||||
uint16_t Robot_ID; //本机器人ID
|
||||
uint16_t Cilent_ID; //本机器人对应的客户端ID
|
||||
uint16_t Receiver_Robot_ID; //机器人车间通信时接收者的ID
|
||||
} referee_id_t;
|
||||
|
||||
// 次结构体包含裁判系统接收数据以及UI绘制与机器人车间通信的相关信息
|
||||
typedef struct
|
||||
{
|
||||
referee_id_t referee_id;
|
||||
|
||||
xFrameHeader FrameHeader; // 接收到的帧头信息
|
||||
uint16_t CmdID;
|
||||
ext_game_state_t GameState; // 0x0001
|
||||
@@ -43,8 +46,7 @@ typedef struct
|
||||
ext_robot_hurt_t RobotHurt; // 0x0206
|
||||
ext_shoot_data_t ShootData; // 0x0207
|
||||
|
||||
// ext_SendClientData_t ShowData; // 客户端信息
|
||||
// ext_CommunatianData_t CommuData; // 队友通信信息
|
||||
// syhtodo 机器人间通信如何获取数据
|
||||
|
||||
} referee_info_t;
|
||||
|
||||
@@ -52,19 +54,19 @@ typedef struct
|
||||
|
||||
/**
|
||||
* @brief 初始化裁判系统,返回接收数据指针
|
||||
*
|
||||
* @param referee_usart_handle
|
||||
* @return referee_info_t*
|
||||
*
|
||||
* @param referee_usart_handle
|
||||
* @return referee_info_t*
|
||||
*/
|
||||
referee_info_t* RefereeInit(UART_HandleTypeDef *referee_usart_handle);
|
||||
referee_info_t *RefereeInit(UART_HandleTypeDef *referee_usart_handle);
|
||||
|
||||
/**
|
||||
* @brief 发送函数
|
||||
* @todo
|
||||
* @todo
|
||||
* @param send 待发送数据
|
||||
*/
|
||||
void RefereeSend(uint8_t *send,uint16_t tx_len);
|
||||
void RefereeSend(uint8_t *send, uint16_t tx_len);
|
||||
|
||||
extern USARTInstance *referee_usart_instance;
|
||||
extern USARTInstance *referee_usart_instance;
|
||||
|
||||
#endif // !REFEREE_H
|
||||
|
||||
Reference in New Issue
Block a user