From bb019caee2d1089382b2ffd4811d178e4d63fb02 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 12 Oct 2023 23:00:40 +0800 Subject: [PATCH] update --- .../step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;