|
|
@@ -175,7 +175,7 @@ bool mc_start(u8 mode) {
|
|
|
}
|
|
|
MC_Check_MosVbusThrottle();
|
|
|
|
|
|
- if (mc_unsafe_critical_error() != 0) {
|
|
|
+ if (mc_unsafe_critical_error()) {
|
|
|
PMSM_FOC_SetErrCode(FOC_Have_CritiCal_Err);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -206,7 +206,7 @@ bool mc_start(u8 mode) {
|
|
|
phase_current_offset_calibrate();
|
|
|
pwm_start();
|
|
|
delay_us(10); //wait for ebrake error
|
|
|
- if (mc_get_critical_error() != 0) {
|
|
|
+ if (mc_unsafe_critical_error()) {
|
|
|
mc_stop();
|
|
|
return false;
|
|
|
}
|
|
|
@@ -589,7 +589,7 @@ static bool mc_is_gpio_mlock(void) {
|
|
|
int count = 50;
|
|
|
int settimes = 0;
|
|
|
while(count-- > 0) {
|
|
|
- bool b1 = mc_get_gpio_brake();
|
|
|
+ bool b1 = gpio_motor_locked();
|
|
|
if (b1) {
|
|
|
settimes ++;
|
|
|
}
|