From 3f9c3c6526191ed0245a1332f95dc1bf23b748e9 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 5 Jun 2024 22:01:24 +0800 Subject: [PATCH] update --- chip/zgpio.hpp | 6 ++++-- components/step_motor_ctrl_module/step_motor_ctrl_module.cpp | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/chip/zgpio.hpp b/chip/zgpio.hpp index 936b545..7afef56 100644 --- a/chip/zgpio.hpp +++ b/chip/zgpio.hpp @@ -85,9 +85,11 @@ class ZGPIO { bool setState(bool state); void toggleState(); + Pin_t getPin() { return m_pin; } + IRQn_Type getEXTIIRQn(); - GPIO_TypeDef *getPort() { return m_gpio; } - uint16_t getPin() { return m_pinoff; } + GPIO_TypeDef *getHalPinPort() { return m_gpio; } + uint16_t getHalPin() { return m_pinoff; } bool tryTriggerIRQ(uint16_t GPIO_Pin); 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 407fdd4..6ad0fc1 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -389,6 +389,9 @@ int32_t StepMotorCtrlModule::step_motor_easy_move_to_zero() { if (m_nio == 0) { return err::kstep_motor_ioindex_out_of_range; } + + if(m_iotable[0].getHalPin()) + return do_step_motor_easy_move_to_zero(); } int32_t StepMotorCtrlModule::step_motor_easy_move_to_io(int32_t ioindex, int32_t direction) {