From a2c45792303627e55ee39039a587750f77354056 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 10 Oct 2023 17:18:36 +0800 Subject: [PATCH] change some api --- components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp | 10 +++++----- components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp index 4bf2b36..63bd95b 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp @@ -9,8 +9,7 @@ using namespace std; void XYRobotCtrlModule::initialize(IStepperMotor* stepM1, // IStepperMotor* stepM2, // ZGPIO* Xgpio, // - ZGPIO* Ygpio, // - float scale) { + ZGPIO* Ygpio) { m_stepM1 = stepM1; m_stepM2 = stepM2; m_Xgpio = Xgpio; @@ -19,9 +18,10 @@ void XYRobotCtrlModule::initialize(IStepperMotor* stepM1, // ZASSERT(m_stepM2); ZASSERT(m_Xgpio); ZASSERT(m_Ygpio); - m_stepM1->setScale(scale); - m_stepM2->setScale(scale); + m_lock.init(); + create_default_cfg(m_cfg); + set_base_param(m_cfg); // m_statu_lock.init(); m_thread.init("XYRobotCtrlModule", 1024, osPriorityNormal); } @@ -29,7 +29,7 @@ void XYRobotCtrlModule::initialize(IStepperMotor* stepM1, // int32_t XYRobotCtrlModule::move_to(int32_t x, int32_t y, action_cb_status_t status_cb) { zlock_guard lock(m_lock); ZLOGI(TAG, "move_to x:%d y:%d", x, y); - //int32_t m1pos, m2pos; + // int32_t m1pos, m2pos; m_thread.stop(); /** * @TODO:Ìí¼ÓÏÞλ¼ì²é diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp index 09fdb54..e6328e1 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp @@ -32,10 +32,9 @@ class XYRobotCtrlModule : public I_XYRobotCtrlModule { public: void initialize(IStepperMotor* stepM1, // - IStepperMotor* stepM2, // - ZGPIO* Xgpio, // - ZGPIO* Ygpio, // - float scale); + IStepperMotor* stepM2, // + ZGPIO* Xgpio, // + ZGPIO* Ygpio); virtual int32_t move_to(int32_t x, int32_t y, action_cb_status_t status_cb) override; virtual int32_t move_by(int32_t dx, int32_t dy, action_cb_status_t status_cb) override;