Преглед изворни кода

解决编译 STEP RESONSE 版本的编译警告

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui пре 2 година
родитељ
комит
5f37ae95c7
2 измењених фајлова са 5 додато и 7 уклоњено
  1. 1 1
      Applications/foc/commands.c
  2. 4 6
      Applications/foc/motor/motor.c

+ 1 - 1
Applications/foc/commands.c

@@ -205,7 +205,7 @@ static void process_foc_command(foc_cmd_body_t *command) {
 				tgt_dq.d = (float)decode_s08(command->data);
 				tgt_dq.d = (float)decode_s08(command->data);
 				tgt_dq.q = (float)decode_s08((u8 *)command->data + 1);
 				tgt_dq.q = (float)decode_s08((u8 *)command->data + 1);
 				foc_set_target_idq(foc(), &tgt_dq);
 				foc_set_target_idq(foc(), &tgt_dq);
-				sys_debug("step res %f, %f\n", target_d, target_q);
+				sys_debug("step res %f, %f\n", tgt_dq.d, tgt_dq.q);
 			}else {
 			}else {
 				erroCode = FOC_Param_Err;
 				erroCode = FOC_Param_Err;
 			}
 			}

+ 4 - 6
Applications/foc/motor/motor.c

@@ -1299,7 +1299,7 @@ static bool mc_run_stall_process(u8 run_mode) {
 	}
 	}
 	return false;
 	return false;
 }
 }
-
+static void mc_autohold_process(void) __attribute__((unused));
 static void mc_autohold_process(void) {
 static void mc_autohold_process(void) {
 	if (!mc_conf()->s.auto_hold) {
 	if (!mc_conf()->s.auto_hold) {
 		if (mot_contrl_is_auto_holdding(&motor.controller)) {
 		if (mot_contrl_is_auto_holdding(&motor.controller)) {
@@ -1331,7 +1331,7 @@ static void mc_autohold_process(void) {
 		motor.n_autohold_time = 0;
 		motor.n_autohold_time = 0;
 	}
 	}
 }
 }
-
+static void mc_process_throttle_epm(void) __attribute__((unused));
 static void mc_process_throttle_epm(void) {
 static void mc_process_throttle_epm(void) {
 	if (!motor.b_epm_cmd_move) {//通过命令前进后退,不处理转把
 	if (!motor.b_epm_cmd_move) {//通过命令前进后退,不处理转把
 		if (mc_throttle_released()) {
 		if (mc_throttle_released()) {
@@ -1341,7 +1341,7 @@ static void mc_process_throttle_epm(void) {
 		}
 		}
 	}
 	}
 }
 }
-
+static void mc_process_epm_move(void) __attribute__((unused));
 static void mc_process_epm_move(void) {
 static void mc_process_epm_move(void) {
 	if (!motor.b_epm || (motor.epm_dir == EPM_Dir_None)){
 	if (!motor.b_epm || (motor.epm_dir == EPM_Dir_None)){
 		return;
 		return;
@@ -1422,7 +1422,6 @@ static void mc_process_curise(void) {
 }
 }
 #endif
 #endif
 
 
-#ifndef CONFIG_DQ_STEP_RESPONSE
 static bool mc_can_stop_foc(void) {
 static bool mc_can_stop_foc(void) {
 	if (mc_critical_need_stop()) {
 	if (mc_critical_need_stop()) {
 		return true;
 		return true;
@@ -1460,8 +1459,6 @@ static bool mc_can_restart_foc(void) {
 	return can_start;
 	return can_start;
 }
 }
 
 
-#endif
-
 static void mc_motor_runstop(void) {
 static void mc_motor_runstop(void) {
 	u32 mask;
 	u32 mask;
 	if (mot_contrl_is_start(&motor.controller) && mc_can_stop_foc()) {
 	if (mot_contrl_is_start(&motor.controller) && mc_can_stop_foc()) {
@@ -1481,6 +1478,7 @@ static void mc_motor_runstop(void) {
 		cpu_exit_critical(mask);
 		cpu_exit_critical(mask);
 	}
 	}
 }
 }
+static void mc_process_throttle_torque(float vol) __attribute__((unused));
 static void mc_process_throttle_torque(float vol) {
 static void mc_process_throttle_torque(float vol) {
 	float torque = throttle_get_torque(&motor.controller, vol);
 	float torque = throttle_get_torque(&motor.controller, vol);