删除废弃注释

This commit is contained in:
NeoZeng 2022-11-23 22:23:58 +08:00
parent 7fc6083879
commit 32c63e4c18
2 changed files with 3 additions and 20 deletions

View File

@ -118,10 +118,10 @@ int main(void){
RC_init(&huart3); RC_init(&huart3);
DWT_Init(168); DWT_Init(168);
Motor_Init_Config_s config = { Motor_Init_Config_s config = {
.motor_type = M3508, .motor_type = GM6020,
.can_init_config = { .can_init_config = {
.can_handle = &hcan1, .can_handle = &hcan1,
.tx_id = 2}, .tx_id = 6},
.controller_setting_init_config = {.angle_feedback_source = MOTOR_FEED, .close_loop_type = SPEED_LOOP | ANGLE_LOOP, .speed_feedback_source = MOTOR_FEED, .reverse_flag = MOTOR_DIRECTION_NORMAL}, .controller_setting_init_config = {.angle_feedback_source = MOTOR_FEED, .close_loop_type = SPEED_LOOP | ANGLE_LOOP, .speed_feedback_source = MOTOR_FEED, .reverse_flag = MOTOR_DIRECTION_NORMAL},
.controller_param_init_config = {.angle_PID = {.Improve = 0, .Kp = 1, .Ki = 0, .Kd = 0, .DeadBand = 0, .MaxOut = 4000}, .speed_PID = {.Improve = 0, .Kp = 1, .Ki = 0, .Kd = 0, .DeadBand = 0, .MaxOut = 4000}}}; .controller_param_init_config = {.angle_PID = {.Improve = 0, .Kp = 1, .Ki = 0, .Kd = 0, .DeadBand = 0, .MaxOut = 4000}, .speed_PID = {.Improve = 0, .Kp = 1, .Ki = 0, .Kd = 0, .DeadBand = 0, .MaxOut = 4000}}};
dji_motor_instance *djimotor = DJIMotorInit(config); dji_motor_instance *djimotor = DJIMotorInit(config);

View File

@ -29,30 +29,13 @@ static void CANAddFilter(can_instance *_instance)
can_filter_conf.FilterMode = CAN_FILTERMODE_IDLIST; can_filter_conf.FilterMode = CAN_FILTERMODE_IDLIST;
can_filter_conf.FilterScale = CAN_FILTERSCALE_16BIT; can_filter_conf.FilterScale = CAN_FILTERSCALE_16BIT;
can_filter_conf.FilterFIFOAssignment = CAN_RX_FIFO1; can_filter_conf.FilterFIFOAssignment = (_instance->tx_id & 1) ? CAN_RX_FIFO0 : CAN_RX_FIFO1;
can_filter_conf.SlaveStartFilterBank = 14; can_filter_conf.SlaveStartFilterBank = 14;
can_filter_conf.FilterIdLow = _instance->rx_id << 5; can_filter_conf.FilterIdLow = _instance->rx_id << 5;
can_filter_conf.FilterIdHigh = _instance->rx_id << 5;
can_filter_conf.FilterMaskIdLow = _instance->rx_id << 5;
can_filter_conf.FilterMaskIdHigh = _instance->rx_id << 5;
can_filter_conf.FilterBank = _instance->can_handle == &hcan1 ? (can1_filter_idx++) : (can2_filter_idx++); can_filter_conf.FilterBank = _instance->can_handle == &hcan1 ? (can1_filter_idx++) : (can2_filter_idx++);
can_filter_conf.FilterActivation = CAN_FILTER_ENABLE; can_filter_conf.FilterActivation = CAN_FILTER_ENABLE;
HAL_CAN_ConfigFilter(_instance->can_handle, &can_filter_conf); HAL_CAN_ConfigFilter(_instance->can_handle, &can_filter_conf);
// CAN_FilterTypeDef can_filter_st;
// can_filter_st.FilterActivation = ENABLE;
// can_filter_st.FilterMode = CAN_FILTERMODE_IDMASK;
// can_filter_st.FilterScale = CAN_FILTERSCALE_32BIT;
// can_filter_st.FilterIdHigh = 0x0000;
// can_filter_st.FilterIdLow = 0x0000;
// can_filter_st.FilterMaskIdHigh = 0x0000;
// can_filter_st.FilterMaskIdLow = 0x0000;
// can_filter_st.FilterBank = 0;
// can_filter_st.FilterFIFOAssignment = CAN_RX_FIFO0;
// HAL_CAN_ConfigFilter(&hcan1, &can_filter_st);
// HAL_CAN_Start(&hcan1);
// HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING);
} }
/** /**