From 49aa1c4693983ad6031f71b0c0b785c6721d9868 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 5 Jun 2024 16:21:15 +0800 Subject: [PATCH] update --- components/step_motor_ctrl_module/step_motor_ctrl_module.hpp | 4 ++++ components/zcancmder/zcan_protocol_parser.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp index 694d2db..f758b9e 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp @@ -79,6 +79,10 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { virtual int32_t step_motor_active_cfg() override; virtual int32_t step_motor_read_io_state(int32_t ioindex, int32_t* state) override; + public: + IStepperMotor* getMotor() { return m_stepM1; } + config_t* getCfg() { return &m_cfg; } + private: void inter_inverse_kinematics(int32_t motor_pos, int32_t& x); void inter_forward_kinematics(int32_t x, int32_t& motor_pos); diff --git a/components/zcancmder/zcan_protocol_parser.hpp b/components/zcancmder/zcan_protocol_parser.hpp index ad2261e..4c7a4a7 100644 --- a/components/zcancmder/zcan_protocol_parser.hpp +++ b/components/zcancmder/zcan_protocol_parser.hpp @@ -39,6 +39,7 @@ class ZCanProtocolParser : public IZCanReceiverListener { void initialize(IZCanReceiver* cancmder); virtual void onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, int32_t len); void registerModule(ZIModule* module); + ZIModule* getModule(int id) { return m_modulers[id]; } private: void _registerModule(uint16_t id, ZIModule* module);