添加了can的发送超时控制,添加了所有application层的文档和注释

This commit is contained in:
NeoZng
2023-01-03 22:53:49 +08:00
parent f37d813bcd
commit 48370d4411
16 changed files with 160 additions and 40 deletions

View File

@@ -288,7 +288,7 @@ void DJIMotorControl()
{
if (sender_enable_flag[i])
{
CANTransmit(&sender_assignment[i]);
CANTransmit(&sender_assignment[i],1);
}
}
}

View File

@@ -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);
}
}

View File

@@ -117,7 +117,7 @@ void LKMotorControl()
if (idx) // 如果有电机注册了
{
CANTransmit(sender_instance);
CANTransmit(sender_instance,1);
}
}

View File

@@ -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;