修复CAN的消息丢失问题,修复robot_def处宏定义错误

This commit is contained in:
NeoZng 2023-04-13 18:23:01 +08:00
parent ec005f163c
commit 681dce3c90
5 changed files with 8 additions and 11 deletions

View File

@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [3.18.0-B7] date: [Thu Apr 13 11:37:21 CST 2023]
# File automatically-generated by tool: [projectgenerator] version: [3.18.0-B7] date: [Thu Apr 13 18:20:17 CST 2023]
##########################################################################################################################
# ------------------------------------------------

View File

@ -47,7 +47,7 @@ void MX_CAN1_Init(void)
hcan1.Init.TimeTriggeredMode = DISABLE;
hcan1.Init.AutoBusOff = DISABLE;
hcan1.Init.AutoWakeUp = DISABLE;
hcan1.Init.AutoRetransmission = DISABLE;
hcan1.Init.AutoRetransmission = ENABLE;
hcan1.Init.ReceiveFifoLocked = DISABLE;
hcan1.Init.TransmitFifoPriority = ENABLE;
if (HAL_CAN_Init(&hcan1) != HAL_OK)
@ -79,7 +79,7 @@ void MX_CAN2_Init(void)
hcan2.Init.TimeTriggeredMode = DISABLE;
hcan2.Init.AutoBusOff = DISABLE;
hcan2.Init.AutoWakeUp = DISABLE;
hcan2.Init.AutoRetransmission = DISABLE;
hcan2.Init.AutoRetransmission = ENABLE;
hcan2.Init.ReceiveFifoLocked = DISABLE;
hcan2.Init.TransmitFifoPriority = ENABLE;
if (HAL_CAN_Init(&hcan2) != HAL_OK)

View File

@ -188,10 +188,7 @@ typedef struct
/* @todo : 对于平衡底盘,需要新增控制模式和控制数据 */
typedef struct
{
#ifdef CHASSIS_BOARD
attitude_t chassis_imu_data;
#endif // CHASSIS_BOARD
// 后续增加底盘的真实速度
// float real_vx;
// float real_vy;

View File

@ -13,14 +13,16 @@ CAN1.BS1=CAN_BS1_10TQ
CAN1.BS2=CAN_BS2_3TQ
CAN1.CalculateBaudRate=1000000
CAN1.CalculateTimeQuantum=71.42857142857143
CAN1.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,CalculateBaudRate,TXFP
CAN1.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,CalculateBaudRate,TXFP,NART
CAN1.NART=ENABLE
CAN1.Prescaler=3
CAN1.TXFP=ENABLE
CAN2.BS1=CAN_BS1_10TQ
CAN2.BS2=CAN_BS2_3TQ
CAN2.CalculateBaudRate=1000000
CAN2.CalculateTimeQuantum=71.42857142857143
CAN2.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,CalculateBaudRate,TXFP
CAN2.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,CalculateBaudRate,TXFP,NART
CAN2.NART=ENABLE
CAN2.Prescaler=3
CAN2.TXFP=ENABLE
Dma.ADC1.8.Direction=DMA_PERIPH_TO_MEMORY

View File

@ -2,9 +2,7 @@
<p align='right'>neozng1@hnu.edu.cn</p>
> TODO:
>
> 1. 增加自动检测ID冲突的log输出。
# 请注意使用CAN设备的时候务必保证总线只接入了2个终端电阻开发板一般都有一个6020电机和HT、LK电机也都有终端电阻注意把多于2个的全部断开通过拨码
## 使用说明