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) {