diff --git a/components/step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.cpp b/components/step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.cpp index 4e51a9e..8fe179d 100644 --- a/components/step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.cpp @@ -1,6 +1,7 @@ -#include "sdk\components\zprotocols\errorcode\errorcode.hpp" #include "zcan_master_step_motor_ctrl_module.hpp" +#include "sdk\components\zprotocols\errorcode\errorcode.hpp" + using namespace iflytop; #define TAG "StepMotorCtrlModule" @@ -114,7 +115,7 @@ class StepMotorCtrlModule : public I_StepMotorCtrlModule { virtual int32_t read_pos(int32_t& pos) { // status_t status; int32_t err = read_status(status); - if (err != 0) { + if (err == 0) { pos = status.x; } return err;