From 234f88f7bd3531684e19b52c7bf65737f788ac1c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 4 Jun 2024 18:21:41 +0800 Subject: [PATCH] update --- components/step_motor_ctrl_module/step_motor_ctrl_module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index 507f2c5..76703a4 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -129,7 +129,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_rotate(int32_t direction) { m_stepM1->setDeceleration(m_cfg.motor_default_dec); int32_t vel = m_cfg.motor_default_velocity; - if (direction == 0) vel = -vel; + if (direction <= 0) vel = -vel; m_stepM1->rotate(vel); while (true) {