修复CAN的消息丢失问题,修复robot_def处宏定义错误
This commit is contained in:
parent
ec005f163c
commit
681dce3c90
2
Makefile
2
Makefile
|
@ -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]
|
||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
|
@ -47,7 +47,7 @@ void MX_CAN1_Init(void)
|
||||||
hcan1.Init.TimeTriggeredMode = DISABLE;
|
hcan1.Init.TimeTriggeredMode = DISABLE;
|
||||||
hcan1.Init.AutoBusOff = DISABLE;
|
hcan1.Init.AutoBusOff = DISABLE;
|
||||||
hcan1.Init.AutoWakeUp = DISABLE;
|
hcan1.Init.AutoWakeUp = DISABLE;
|
||||||
hcan1.Init.AutoRetransmission = DISABLE;
|
hcan1.Init.AutoRetransmission = ENABLE;
|
||||||
hcan1.Init.ReceiveFifoLocked = DISABLE;
|
hcan1.Init.ReceiveFifoLocked = DISABLE;
|
||||||
hcan1.Init.TransmitFifoPriority = ENABLE;
|
hcan1.Init.TransmitFifoPriority = ENABLE;
|
||||||
if (HAL_CAN_Init(&hcan1) != HAL_OK)
|
if (HAL_CAN_Init(&hcan1) != HAL_OK)
|
||||||
|
@ -79,7 +79,7 @@ void MX_CAN2_Init(void)
|
||||||
hcan2.Init.TimeTriggeredMode = DISABLE;
|
hcan2.Init.TimeTriggeredMode = DISABLE;
|
||||||
hcan2.Init.AutoBusOff = DISABLE;
|
hcan2.Init.AutoBusOff = DISABLE;
|
||||||
hcan2.Init.AutoWakeUp = DISABLE;
|
hcan2.Init.AutoWakeUp = DISABLE;
|
||||||
hcan2.Init.AutoRetransmission = DISABLE;
|
hcan2.Init.AutoRetransmission = ENABLE;
|
||||||
hcan2.Init.ReceiveFifoLocked = DISABLE;
|
hcan2.Init.ReceiveFifoLocked = DISABLE;
|
||||||
hcan2.Init.TransmitFifoPriority = ENABLE;
|
hcan2.Init.TransmitFifoPriority = ENABLE;
|
||||||
if (HAL_CAN_Init(&hcan2) != HAL_OK)
|
if (HAL_CAN_Init(&hcan2) != HAL_OK)
|
||||||
|
|
|
@ -188,10 +188,7 @@ typedef struct
|
||||||
/* @todo : 对于平衡底盘,需要新增控制模式和控制数据 */
|
/* @todo : 对于平衡底盘,需要新增控制模式和控制数据 */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
#ifdef CHASSIS_BOARD
|
|
||||||
attitude_t chassis_imu_data;
|
attitude_t chassis_imu_data;
|
||||||
#endif // CHASSIS_BOARD
|
|
||||||
|
|
||||||
// 后续增加底盘的真实速度
|
// 后续增加底盘的真实速度
|
||||||
// float real_vx;
|
// float real_vx;
|
||||||
// float real_vy;
|
// float real_vy;
|
||||||
|
|
|
@ -13,14 +13,16 @@ CAN1.BS1=CAN_BS1_10TQ
|
||||||
CAN1.BS2=CAN_BS2_3TQ
|
CAN1.BS2=CAN_BS2_3TQ
|
||||||
CAN1.CalculateBaudRate=1000000
|
CAN1.CalculateBaudRate=1000000
|
||||||
CAN1.CalculateTimeQuantum=71.42857142857143
|
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.Prescaler=3
|
||||||
CAN1.TXFP=ENABLE
|
CAN1.TXFP=ENABLE
|
||||||
CAN2.BS1=CAN_BS1_10TQ
|
CAN2.BS1=CAN_BS1_10TQ
|
||||||
CAN2.BS2=CAN_BS2_3TQ
|
CAN2.BS2=CAN_BS2_3TQ
|
||||||
CAN2.CalculateBaudRate=1000000
|
CAN2.CalculateBaudRate=1000000
|
||||||
CAN2.CalculateTimeQuantum=71.42857142857143
|
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.Prescaler=3
|
||||||
CAN2.TXFP=ENABLE
|
CAN2.TXFP=ENABLE
|
||||||
Dma.ADC1.8.Direction=DMA_PERIPH_TO_MEMORY
|
Dma.ADC1.8.Direction=DMA_PERIPH_TO_MEMORY
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
<p align='right'>neozng1@hnu.edu.cn</p>
|
<p align='right'>neozng1@hnu.edu.cn</p>
|
||||||
|
|
||||||
> TODO:
|
# 请注意使用CAN设备的时候务必保证总线只接入了2个终端电阻!开发板一般都有一个,6020电机和HT、LK电机也都有终端电阻,注意把多于2个的全部断开(通过拨码)
|
||||||
>
|
|
||||||
> 1. 增加自动检测ID冲突的log输出。
|
|
||||||
|
|
||||||
## 使用说明
|
## 使用说明
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue