|
|
@ -70,7 +70,7 @@ int32_t StepMotorCtrlModule::module_xxx_reg(int32_t param_id, bool read, int32_t |
|
|
|
case kreg_step_motor_iholddelay: |
|
|
|
case kreg_step_motor_max_d: |
|
|
|
case kreg_step_motor_min_d: |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return suc; |
|
|
|
} |
|
|
@ -150,8 +150,14 @@ int32_t StepMotorCtrlModule::step_motor_read_io_state(int32_t ioindex, int32_t* |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t StepMotorCtrlModule::step_motor_read_motoric_status(int32_t* errorflag) { |
|
|
|
*errorflag = m_state.motorStatus; |
|
|
|
int32_t StepMotorCtrlModule::step_motor_read_tmc5130_status(int32_t* status) { |
|
|
|
// *errorflag = m_state.motorStatus;
|
|
|
|
TMC5130* tmc5130 = dynamic_cast<TMC5130*>(m_stepM1); |
|
|
|
if (tmc5130) { |
|
|
|
static_assert(sizeof(TMC5130::DevStatusReg_t) == 4); |
|
|
|
auto devStatus = tmc5130->getDevStatus(); |
|
|
|
memcpy(status, &devStatus, sizeof(int32_t)); |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@ -203,7 +209,7 @@ void StepMotorCtrlModule::dumpTMC5130Status(TMC5130::DevStatusReg_t* status) { |
|
|
|
|
|
|
|
void StepMotorCtrlModule::setErrorFlag(int32_t ecode, uint32_t motorStatue) { |
|
|
|
creg.module_errorcode = ecode; |
|
|
|
m_state.motorStatus = motorStatue; |
|
|
|
// m_state.motorStatus = motorStatue;
|
|
|
|
} |
|
|
|
|
|
|
|
bool StepMotorCtrlModule::check_when_run() { |
|
|
|