Explorar el Código

用户设置的idc limit小于零,不处理,通过这个设置可以读取当前的限流

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui hace 3 años
padre
commit
ef4d3b963a
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Applications/foc/motor/motor.c

+ 1 - 1
Applications/foc/motor/motor.c

@@ -411,7 +411,7 @@ bool mc_set_cruise_speed(bool rpm_abs, float target_rpm) {
 }
 
 void mc_set_idc_limit(s16 limit) {
-	if (limit == motor.idc_user_lim) {
+	if ((limit == motor.idc_user_lim) || (limit < 0)) {
 		return;
 	}
 	motor.idc_user_lim = limit;