mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
添加了can的发送超时控制,添加了所有application层的文档和注释
This commit is contained in:
@@ -288,7 +288,7 @@ void DJIMotorControl()
|
||||
{
|
||||
if (sender_enable_flag[i])
|
||||
{
|
||||
CANTransmit(&sender_assignment[i]);
|
||||
CANTransmit(&sender_assignment[i],1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ static void HTMotorSetMode(HTMotor_Mode_t cmd, HTMotorInstance *motor)
|
||||
static uint8_t buf[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00};
|
||||
buf[7] = (uint8_t)cmd;
|
||||
memcpy(motor->motor_can_instace->tx_buff, buf, sizeof(buf));
|
||||
CANTransmit(motor->motor_can_instace);
|
||||
CANTransmit(motor->motor_can_instace,1);
|
||||
}
|
||||
|
||||
/* 两个用于将uint值和float值进行映射的函数,在设定发送值和解析反馈值时使用 */
|
||||
@@ -144,7 +144,7 @@ void HTMotorControl()
|
||||
{ // 若该电机处于停止状态,直接将发送buff置零
|
||||
memset(motor_can->tx_buff + 6, 0, sizeof(uint16_t));
|
||||
}
|
||||
CANTransmit(motor_can);
|
||||
CANTransmit(motor_can,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void LKMotorControl()
|
||||
|
||||
if (idx) // 如果有电机注册了
|
||||
{
|
||||
CANTransmit(sender_instance);
|
||||
CANTransmit(sender_instance,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ typedef enum
|
||||
ANGLE_LOOP = 0b0100,
|
||||
|
||||
// only for checking
|
||||
_ = 0b0011,
|
||||
__ = 0b0110,
|
||||
___ = 0b0111
|
||||
SPEED_AND_CURRENT_LOOP = 0b0011,
|
||||
ANGLE_AND_SPEED_LOOP = 0b0110,
|
||||
ALL_THREE_LOOP = 0b0111
|
||||
} Closeloop_Type_e;
|
||||
|
||||
typedef enum
|
||||
@@ -80,7 +80,6 @@ typedef struct
|
||||
{
|
||||
float *other_angle_feedback_ptr; // 其他反馈来源的反馈数据指针
|
||||
float *other_speed_feedback_ptr;
|
||||
// float *angle_foward_ptr; //前馈数据指针
|
||||
// float *speed_foward_ptr;
|
||||
// float *current_foward_ptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user