From 67940a4e388afc53dabf77601565c86b09e4a83a Mon Sep 17 00:00:00 2001 From: kidneygood <2979564623@qq.com> Date: Thu, 26 Jan 2023 15:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81UI=E6=A0=B7=E4=BE=8B=E7=BB=98?= =?UTF-8?q?=E5=88=B6=E3=80=81=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/gimbal/gimbal.c | 3 +- application/referee/referee.c | 393 ++++++++++++++++++++-------------- application/referee/referee.h | 4 +- modules/referee/referee_UI.c | 3 +- modules/referee/referee_def.h | 4 +- modules/referee/rm_referee.c | 2 +- 6 files changed, 233 insertions(+), 176 deletions(-) diff --git a/application/gimbal/gimbal.c b/application/gimbal/gimbal.c index c193e87..e7ef766 100644 --- a/application/gimbal/gimbal.c +++ b/application/gimbal/gimbal.c @@ -16,8 +16,7 @@ static Gimbal_Ctrl_Cmd_s gimbal_cmd_recv; // 来自cmd的控制信息 void GimbalInit() { - /* syh referee不需要imu - 暂时关闭以加快初始化速度 */ + /* syh referee不需要imu暂时关闭以加快初始化速度 */ // gimba_IMU_data = INS_Init(); // IMU先初始化,获取姿态数据指针赋给yaw电机的其他数据来源 // YAW diff --git a/application/referee/referee.c b/application/referee/referee.c index 98d50f9..7915f2a 100644 --- a/application/referee/referee.c +++ b/application/referee/referee.c @@ -14,16 +14,18 @@ #include "referee_UI.h" static Referee_Interactive_info_t Interactive_data; // 非裁判系统数据 -static referee_info_t *referee_data; // 裁判系统相关数据 +static referee_info_t *referee_data; // 裁判系统相关数据 static void determine_ID(referee_info_t *_referee_info); static void My_UI_init(referee_info_t *_referee_info); static void My_UI_Refresh(referee_info_t *_referee_info, Referee_Interactive_info_t *_Interactive_data); static void robot_mode_change(Referee_Interactive_info_t *_Interactive_data); // 测试用函数,实现模式自动变化 +static void Mode_Change_Check(Referee_Interactive_info_t *_Interactive_data); // 模式切换检测 void Referee_Interactive_init() { referee_data = RefereeInit(&huart6); // 裁判系统初始化 - while (referee_data->GameRobotState.robot_id == 0); + while (referee_data->GameRobotState.robot_id == 0) + ; determine_ID(referee_data); My_UI_init(referee_data); } @@ -35,8 +37,8 @@ void Referee_Interactive_task() } static Graph_Data_t UI_shoot_line[10]; // 射击准线 -static String_Data_t UI_State_sta[5]; // 机器人状态,静态只需画一次 -static String_Data_t UI_State_dyn[5]; // 机器人状态,动态先add才能change +static String_Data_t UI_State_sta[6]; // 机器人状态,静态只需画一次 +static String_Data_t UI_State_dyn[6]; // 机器人状态,动态先add才能change static uint32_t shoot_line_location[10] = {540, 960, 490, 515, 565}; static void My_UI_init(referee_info_t *_referee_info) @@ -62,40 +64,48 @@ static void My_UI_init(referee_info_t *_referee_info) Char_ReFresh(&_referee_info->referee_id, UI_State_sta[1]); Char_Draw(&UI_State_sta[2], "ss2", UI_Graph_ADD, 8, UI_Color_Orange, 15, 2, 150, 650); - Char_Write(&UI_State_sta[2], "cover:"); + Char_Write(&UI_State_sta[2], "shoot:"); Char_ReFresh(&_referee_info->referee_id, UI_State_sta[2]); Char_Draw(&UI_State_sta[3], "ss3", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 150, 600); Char_Write(&UI_State_sta[3], "frict:"); Char_ReFresh(&_referee_info->referee_id, UI_State_sta[3]); - // 底盘功率显示,静态 - Char_Draw(&UI_State_sta[4], "ss4", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 720, 210); - Char_Write(&UI_State_sta[4], "Power:"); + Char_Draw(&UI_State_sta[4], "ss4", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 150, 550); + Char_Write(&UI_State_sta[4], "lid:"); Char_ReFresh(&_referee_info->referee_id, UI_State_sta[4]); - // 绘制车辆状态标志,动态 - //syhtodo 由于初始化时xxx_last_mode默认为0,所以此处对应UI也应该设为0时对应的UI,防止模式不变的情况下无法置位flag,导致UI无法刷新 + // 底盘功率显示,静态 + Char_Draw(&UI_State_sta[5], "ss5", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 720, 210); + Char_Write(&UI_State_sta[5], "Power:"); + Char_ReFresh(&_referee_info->referee_id, UI_State_sta[5]); + + // 绘制车辆状态标志,动态 + // 由于初始化时xxx_last_mode默认为0,所以此处对应UI也应该设为0时对应的UI,防止模式不变的情况下无法置位flag,导致UI无法刷新 Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_ADD, 8, UI_Color_Main, 15, 2, 270, 750); - Char_Write(&UI_State_dyn[0], "0000"); + Char_Write(&UI_State_dyn[0], "zeroforce"); Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[0]); Char_Draw(&UI_State_dyn[1], "sd1", UI_Graph_ADD, 8, UI_Color_Yellow, 15, 2, 270, 700); - Char_Write(&UI_State_dyn[1], "0000"); + Char_Write(&UI_State_dyn[1], "zeroforce"); Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[1]); Char_Draw(&UI_State_dyn[2], "sd2", UI_Graph_ADD, 8, UI_Color_Orange, 15, 2, 270, 650); - Char_Write(&UI_State_dyn[2], "0000"); + Char_Write(&UI_State_dyn[2], "off"); Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[2]); Char_Draw(&UI_State_dyn[3], "sd3", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 270, 600); - Char_Write(&UI_State_dyn[3], "0000"); + Char_Write(&UI_State_dyn[3], "off"); Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[3]); - // 底盘功率显示,动态 - Char_Draw(&UI_State_dyn[4], "sd4", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 840, 210); - Char_Write(&UI_State_dyn[4], "0000"); + Char_Draw(&UI_State_dyn[4], "sd4", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 270, 550); + Char_Write(&UI_State_dyn[4], "open "); Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[4]); + + // 底盘功率显示,动态 + Char_Draw(&UI_State_dyn[5], "sd5", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 840, 210); + Char_Write(&UI_State_dyn[5], "0000"); + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[5]); } static uint8_t count = 0; @@ -108,174 +118,225 @@ static void robot_mode_change(Referee_Interactive_info_t *_Interactive_data) // count = 0; count1++; } - switch (count1%4) + switch (count1 % 4) { - case 0: - { - _Interactive_data->chassis_mode =CHASSIS_ZERO_FORCE; - _Interactive_data->gimbal_mode =GIMBAL_ZERO_FORCE; - _Interactive_data->shoot_mode = SHOOT_ON; - _Interactive_data->friction_mode = FRICTION_ON; - _Interactive_data->lid_mode = LID_OPEN; - break; - - } - case 1: - {; - _Interactive_data->chassis_mode =CHASSIS_ROTATE; - _Interactive_data->gimbal_mode =GIMBAL_FREE_MODE; - _Interactive_data->shoot_mode = SHOOT_OFF; - _Interactive_data->friction_mode = FRICTION_OFF; - _Interactive_data->lid_mode = LID_CLOSE; - break; - } - case 2: - { - _Interactive_data->chassis_mode =CHASSIS_NO_FOLLOW; - _Interactive_data->gimbal_mode =GIMBAL_GYRO_MODE; - _Interactive_data->shoot_mode = SHOOT_ON; - _Interactive_data->friction_mode = FRICTION_ON; - _Interactive_data->lid_mode = LID_OPEN; - break; - } - case 3: - { - _Interactive_data->chassis_mode =CHASSIS_FOLLOW_GIMBAL_YAW; - _Interactive_data->gimbal_mode =GIMBAL_ZERO_FORCE; - _Interactive_data->shoot_mode = SHOOT_OFF; - _Interactive_data->friction_mode = FRICTION_OFF; - _Interactive_data->lid_mode = LID_CLOSE; - break; - } - default : break; - } + case 0: + { + _Interactive_data->chassis_mode = CHASSIS_ZERO_FORCE; + _Interactive_data->gimbal_mode = GIMBAL_ZERO_FORCE; + _Interactive_data->shoot_mode = SHOOT_ON; + _Interactive_data->friction_mode = FRICTION_ON; + _Interactive_data->lid_mode = LID_OPEN; + break; + } + case 1: + { + ; + _Interactive_data->chassis_mode = CHASSIS_ROTATE; + _Interactive_data->gimbal_mode = GIMBAL_FREE_MODE; + _Interactive_data->shoot_mode = SHOOT_OFF; + _Interactive_data->friction_mode = FRICTION_OFF; + _Interactive_data->lid_mode = LID_CLOSE; + break; + } + case 2: + { + _Interactive_data->chassis_mode = CHASSIS_NO_FOLLOW; + _Interactive_data->gimbal_mode = GIMBAL_GYRO_MODE; + _Interactive_data->shoot_mode = SHOOT_ON; + _Interactive_data->friction_mode = FRICTION_ON; + _Interactive_data->lid_mode = LID_OPEN; + break; + } + case 3: + { + _Interactive_data->chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW; + _Interactive_data->gimbal_mode = GIMBAL_ZERO_FORCE; + _Interactive_data->shoot_mode = SHOOT_OFF; + _Interactive_data->friction_mode = FRICTION_OFF; + _Interactive_data->lid_mode = LID_CLOSE; + break; + } + default: + break; + } } static void My_UI_Refresh(referee_info_t *_referee_info, Referee_Interactive_info_t *_Interactive_data) { // syhtodo 按键刷新 - // syhtodo与上次不一样才要进入刷新,避免重复发送,使用新结构体flag - if (_Interactive_data->chassis_mode !=_Interactive_data->chassis_last_mode) + + Mode_Change_Check(_Interactive_data); + // chassis + if (_Interactive_data->Referee_Interactive_Flag.chassis_flag == 1) { - _Interactive_data->Referee_Interactive_Flag.chassis_flag=1; + switch (_Interactive_data->chassis_mode) + { + case CHASSIS_ZERO_FORCE: + { + Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); + Char_Write(&UI_State_dyn[0], "zeroforce"); + break; + } + case CHASSIS_ROTATE: + { + Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); + Char_Write(&UI_State_dyn[0], "rotate "); // 此处注意字数对齐问题,字数相同才能覆盖掉 + break; + } + case CHASSIS_NO_FOLLOW: + { + Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); + Char_Write(&UI_State_dyn[0], "nofollow "); + break; + } + case CHASSIS_FOLLOW_GIMBAL_YAW: + { + Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); + Char_Write(&UI_State_dyn[0], "follow "); + break; + } + } + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[0]); + _Interactive_data->Referee_Interactive_Flag.chassis_flag = 0; + } + // gimbal + if (_Interactive_data->Referee_Interactive_Flag.gimbal_flag == 1) + { + switch (_Interactive_data->gimbal_mode) + { + case GIMBAL_ZERO_FORCE: + { + Char_Draw(&UI_State_dyn[1], "sd1", UI_Graph_Change, 8, UI_Color_Yellow, 15, 2, 270, 700); + Char_Write(&UI_State_dyn[1], "zeroforce"); + break; + } + case GIMBAL_FREE_MODE: + { + Char_Draw(&UI_State_dyn[1], "sd1", UI_Graph_Change, 8, UI_Color_Yellow, 15, 2, 270, 700); + Char_Write(&UI_State_dyn[1], "free "); + break; + } + case GIMBAL_GYRO_MODE: + { + Char_Draw(&UI_State_dyn[1], "sd1", UI_Graph_Change, 8, UI_Color_Yellow, 15, 2, 270, 700); + Char_Write(&UI_State_dyn[1], "gyro "); + break; + } + } + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[1]); + _Interactive_data->Referee_Interactive_Flag.gimbal_flag = 0; + } + // shoot + if (_Interactive_data->Referee_Interactive_Flag.shoot_flag == 1) + { + switch (_Interactive_data->shoot_mode) + { + case SHOOT_OFF: + { + Char_Draw(&UI_State_dyn[2], "sd2", UI_Graph_Change, 8, UI_Color_Orange, 15, 2, 270, 650); + Char_Write(&UI_State_dyn[2], "off"); + break; + } + case SHOOT_ON: + { + Char_Draw(&UI_State_dyn[2], "sd2", UI_Graph_Change, 8, UI_Color_Orange, 15, 2, 270, 650); + Char_Write(&UI_State_dyn[2], "on "); + break; + } + } + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[2]); + _Interactive_data->Referee_Interactive_Flag.shoot_flag = 0; + } + + // friction + if (_Interactive_data->Referee_Interactive_Flag.friction_flag == 1) + { + switch (_Interactive_data->friction_mode) + { + case FRICTION_OFF: + { + Char_Draw(&UI_State_dyn[3], "sd3", UI_Graph_Change, 8, UI_Color_Pink, 15, 2, 270, 600); + Char_Write(&UI_State_dyn[3], "off"); + break; + } + case FRICTION_ON: + { + Char_Draw(&UI_State_dyn[3], "sd3", UI_Graph_Change, 8, UI_Color_Pink, 15, 2, 270, 600); + Char_Write(&UI_State_dyn[3], "on "); + break; + } + } + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[3]); + _Interactive_data->Referee_Interactive_Flag.friction_flag = 0; + } + // lid + if (_Interactive_data->Referee_Interactive_Flag.lid_flag == 1) + { + switch (_Interactive_data->lid_mode) + { + case LID_CLOSE: + { + Char_Draw(&UI_State_dyn[4], "sd4", UI_Graph_Change, 8, UI_Color_Pink, 15, 2, 270, 550); + Char_Write(&UI_State_dyn[4], "close"); + break; + } + case LID_OPEN: + { + Char_Draw(&UI_State_dyn[4], "sd4", UI_Graph_Change, 8, UI_Color_Pink, 15, 2, 270, 550); + Char_Write(&UI_State_dyn[4], "open "); + break; + } + } + Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[4]); + _Interactive_data->Referee_Interactive_Flag.lid_flag = 0; + } +} + + +/** + * @brief 模式切换检测,模式发生切换时,对flag置位 + * @param Referee_Interactive_info_t *_Interactive_data + * @retval none + * @attention + */ +static void Mode_Change_Check(Referee_Interactive_info_t *_Interactive_data) +{ + if (_Interactive_data->chassis_mode != _Interactive_data->chassis_last_mode) + { + _Interactive_data->Referee_Interactive_Flag.chassis_flag = 1; _Interactive_data->chassis_last_mode = _Interactive_data->chassis_mode; } - if (_Interactive_data->Referee_Interactive_Flag.chassis_flag==1) + if (_Interactive_data->gimbal_mode != _Interactive_data->gimbal_last_mode) { - switch(_Interactive_data->chassis_mode) - { - case CHASSIS_ZERO_FORCE: - { - Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); - Char_Write(&UI_State_dyn[0], "zeroforce"); - break; - } - case CHASSIS_ROTATE: - { - Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); - Char_Write(&UI_State_dyn[0], "rotate "); //此处注意字数对齐问题,字数相同才能覆盖掉 - break; - } - case CHASSIS_NO_FOLLOW: - { - Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); - Char_Write(&UI_State_dyn[0], "nofollow "); - break; - } - case CHASSIS_FOLLOW_GIMBAL_YAW: - { - Char_Draw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 15, 2, 270, 750); - Char_Write(&UI_State_dyn[0], "follow "); - break; - } - } - - Char_ReFresh(&_referee_info->referee_id, UI_State_dyn[0]); - _Interactive_data->Referee_Interactive_Flag.chassis_flag=0; + _Interactive_data->Referee_Interactive_Flag.gimbal_flag = 1; + _Interactive_data->gimbal_last_mode = _Interactive_data->gimbal_mode; } + if (_Interactive_data->shoot_mode != _Interactive_data->shoot_last_mode) + { + _Interactive_data->Referee_Interactive_Flag.shoot_flag = 1; + _Interactive_data->shoot_last_mode = _Interactive_data->shoot_mode; + } + if (_Interactive_data->friction_mode != _Interactive_data->friction_last_mode) + { + _Interactive_data->Referee_Interactive_Flag.friction_flag = 1; + _Interactive_data->friction_last_mode = _Interactive_data->friction_mode; + } - - - - - - - // switch(dbus_infomation.gimbal_mode) - // { - // case mechanical_mode: - // { - // Char_Draw(&UI_State[1],"s2",UI_Graph_Change,8,UI_Color_Yellow,15,2,150,700); - // Char_Write(&UI_State[1],"gimbal:mech "); - // break; - // } - // case visual_mode: - // { - // Char_Draw(&UI_State[1],"s2",UI_Graph_Change,8,UI_Color_Yellow,15,2,150,700); - // Char_Write(&UI_State[1],"gimbal:visual"); - // break; - // } - // case gyro_mode: - // { - // Char_Draw(&UI_State[1],"s2",UI_Graph_Change,8,UI_Color_Yellow,15,2,150,700); - // Char_Write(&UI_State[1],"gimbal:gyro "); - // break; - // } - // } - // Char_ReFresh(UI_State[1]); - - // switch(dbus_infomation.cover_state) - // { - // case cover_close_sign: - // { - // Char_Draw(&UI_State[2],"s3",UI_Graph_Change,8,UI_Color_Orange,15,2,150,650); - // Char_Write(&UI_State[2],"cover:OFF"); - // break; - // } - // case cover_open_sign: - // { - // Char_Draw(&UI_State[2],"s3",UI_Graph_Change,8,UI_Color_Orange,15,2,150,650); - // Char_Write(&UI_State[2],"cover:ON "); - // break; - // } - // } - // Char_ReFresh(UI_State[2]); - - // switch(dbus_infomation.friction_state) - // { - // case friction_stop_sign: - // { - // Char_Draw(&UI_State[3],"s4",UI_Graph_Change,8,UI_Color_Pink,15,2,150,600); - // Char_Write(&UI_State[3],"friction:OFF"); - // break; - // } - // case friction_start_sign: - // { - // Char_Draw(&UI_State[3],"s4",UI_Graph_Change,8,UI_Color_Pink,15,2,150,600); - // Char_Write(&UI_State[3],"friction:ON "); - // break; - // } - // } - // Char_ReFresh(UI_State[3]); - - // } - // else if(timer_count == PEFEREE_PERIOD_TX_C/2) - // { - // //功率值变化 - // Char_Draw(&UI_State[4],"s5",UI_Graph_Change,8,UI_Color_Green,18,2,720,240); - // Char_Write(&UI_State[4],"Voltage:%dV",super_cap_info.cap_voltage_cap); - // Char_ReFresh(UI_State[4]); - // } - - // } + if (_Interactive_data->lid_mode != _Interactive_data->lid_last_mode) + { + _Interactive_data->Referee_Interactive_Flag.lid_flag = 1; + _Interactive_data->lid_last_mode = _Interactive_data->lid_mode; + } } /** * @brief 判断各种ID,选择客户端ID - * @param void - * @retval referee_info + * @param referee_info_t *_referee_info + * @retval none * @attention */ static void determine_ID(referee_info_t *_referee_info) diff --git a/application/referee/referee.h b/application/referee/referee.h index 8f6bf54..d531d5a 100644 --- a/application/referee/referee.h +++ b/application/referee/referee.h @@ -10,10 +10,10 @@ typedef struct { uint32_t chassis_flag : 1; uint32_t gimbal_flag : 1; - uint32_t cover_flag : 1; + uint32_t shoot_flag : 1; + uint32_t lid_flag : 1; uint32_t friction_flag : 1; uint32_t Power_flag : 1; - uint32_t end_angle_flag : 1; } Referee_Interactive_Flag_t; diff --git a/modules/referee/referee_UI.c b/modules/referee/referee_UI.c index 0ae93c7..074e323 100644 --- a/modules/referee/referee_UI.c +++ b/modules/referee/referee_UI.c @@ -30,7 +30,7 @@ void UI_Delete(referee_id_t *_id,uint8_t Del_Operate,uint8_t Del_Layer) UI_delete_data.Layer = Del_Layer; UI_delete_data.frametail = Get_CRC16_Check_Sum((uint8_t *)&UI_delete_data,LEN_HEADER+LEN_CMDID+temp_datalength,0xFFFF); - /* syhtodo为什么填入0xFFFF */ + /* syhtodo为什么填入0xFFFF,关于crc校验 */ RefereeSend((uint8_t *)&UI_delete_data,LEN_HEADER+LEN_CMDID+temp_datalength+LEN_TAIL); //发送 @@ -321,7 +321,6 @@ void Char_Draw(String_Data_t *graph,char graphname[3],uint32_t Graph_Operate,uin **参数:*graph Graph_Data类型变量指针,用于存放图形数据 fmt需要显示的字符串 此函数的实现和具体使用类似于printf函数 -syhtodo 尚未理解该函数的写法 **********************************************************************************************************/ void Char_Write(String_Data_t *graph,char* fmt, ...) { diff --git a/modules/referee/referee_def.h b/modules/referee/referee_def.h index e598af3..ac82dfb 100644 --- a/modules/referee/referee_def.h +++ b/modules/referee/referee_def.h @@ -228,9 +228,7 @@ typedef struct /****************************机器人间交互数据****************************/ /****************************机器人间交互数据****************************/ -/* 发送的内容数据段最大为 113 检测是否超出大小限制 -实际上图形段不会超,数据段最多30个,也不会超,检查验证一下 - syhtodo */ +/* 发送的内容数据段最大为 113 检测是否超出大小限制?实际上图形段不会超,数据段最多30个,也不会超下*/ /* 交互数据头结构 */ typedef struct { diff --git a/modules/referee/rm_referee.c b/modules/referee/rm_referee.c index e951374..b73b32c 100644 --- a/modules/referee/rm_referee.c +++ b/modules/referee/rm_referee.c @@ -40,7 +40,7 @@ referee_info_t *RefereeInit(UART_HandleTypeDef *referee_usart_handle) void RefereeSend(uint8_t *send,uint16_t tx_len) { USARTSend(referee_usart_instance,send,tx_len); - /* syhtodo DMA请求过快会导致数据发送丢失,考虑数据尽可能打成一个整包以及队列发送 */ + /* syhtodo DMA请求过快会导致数据发送丢失,考虑数据尽可能打成一个整包以及队列发送,并且发送函数添加缓冲区 */ HAL_Delay(5); }