mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-23 19:25:09 +08:00
波特率提升为921600,修复了和视觉通信的溢出错误以及DMA冲突.
This commit is contained in:
@@ -61,5 +61,8 @@ void VisionSend(Vision_Send_s *send)
|
||||
|
||||
// 将数据转化为seasky协议的数据包
|
||||
get_protocol_send_data(0x02, flag_register, &send->yaw, 3, send_buff, &tx_len);
|
||||
USARTSend(vision_usart_instance, send_buff, tx_len);
|
||||
USARTSend(vision_usart_instance, send_buff, tx_len,USART_TRANSFER_IT); // 和视觉通信使用IT,防止和接收使用的DMA冲突
|
||||
// 此处为HAL设计的缺陷,DMASTOP会停止发送和接收,导致再也无法进入接收中断.
|
||||
// 也可在发送完成中断中重新启动DMA接收,但较为复杂.因此,此处使用IT发送.
|
||||
|
||||
}
|
||||
@@ -114,7 +114,7 @@ uint16_t get_protocol_info(uint8_t *rx_buf, // 接收到的原始数据
|
||||
if (CRC16_Check_Sum(&rx_buf[0], date_length))
|
||||
{
|
||||
*flags_register = (rx_buf[7] << 8) | rx_buf[6];
|
||||
memcpy(rx_data, rx_buf + 8, 4 * sizeof(pro.header.data_length - 2));
|
||||
memcpy(rx_data, rx_buf + 8, pro.header.data_length - 2);
|
||||
return pro.cmd_id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# referee
|
||||
|
||||
当前模块组织较为混乱,后续统一为多机通信+裁判系统信息接收+UI绘制。UI绘制和多机通信的发送部分在referee任务中以一定的频率运行,信息的接收通过中断完成。
|
||||
@@ -41,7 +41,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);
|
||||
USARTSend(referee_usart_instance, send, tx_len,USART_TRANSFER_IT);
|
||||
/* syhtodo DMA请求过快会导致数据发送丢失,考虑数据尽可能打成一个整包以及队列发送,并且发送函数添加缓冲区 */
|
||||
HAL_Delay(5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user