Skip to content

Commit ff6f165

Browse files
committed
Don't send motor current if the package is disabled
1 parent 9b6ebd6 commit ff6f165

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,11 @@ static void refloat_thd(void *arg) {
14551455
break;
14561456
}
14571457

1458-
motor_control_apply(
1459-
&d->motor_control, d->motor.abs_erpm_smooth, d->state.state, d->current_time
1460-
);
1458+
if (d->state.state != STATE_DISABLED) {
1459+
motor_control_apply(
1460+
&d->motor_control, d->motor.abs_erpm_smooth, d->state.state, d->current_time
1461+
);
1462+
}
14611463
VESC_IF->sleep_us(d->loop_time_us);
14621464
}
14631465
}

0 commit comments

Comments
 (0)