|
|
@ -2,15 +2,15 @@ |
|
|
|
using namespace iflytop; |
|
|
|
#define TAG "TmcMotorGroup"
|
|
|
|
using namespace transmit_disfection_protocol; |
|
|
|
using namespace zscanprotocol; |
|
|
|
using namespace err; |
|
|
|
// using namespace zscanprotocol;
|
|
|
|
// using namespace err;
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 电机异常监控 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
static osTimerId MotorMonitorTimerId; // 压力传感器数值上报
|
|
|
|
static bool motorErrorFlagCache[10]; // 电机异常状态上报标志位
|
|
|
|
static zmutex motorErrorFlagCacheLock; |
|
|
|
static zmutex motorErrorFlagCacheLock = {"motorErrorFlagCacheLock"}; |
|
|
|
static TmcMotorGroup* tmcgroup_p; |
|
|
|
|
|
|
|
static bool motorErrorFlag_get(int subindex) { |
|
|
@ -115,11 +115,11 @@ void TmcMotorGroup::initialize(Pin_t tmcPowerPin, TMC51X0Cfg cfg0, TMC51X0Cfg cf |
|
|
|
m_tmc_power_pin.write(true); |
|
|
|
// PB2
|
|
|
|
|
|
|
|
m_motor[0].initialize(cfg0); |
|
|
|
m_motor[0].initialize(0, cfg0); |
|
|
|
m_motor[0].setIHOLD_IRUN(1, 20, 0); |
|
|
|
m_motor[0].setMotorShaft(true); |
|
|
|
|
|
|
|
m_motor[1].initialize(cfg1); |
|
|
|
m_motor[1].initialize(1, cfg1); |
|
|
|
m_motor[1].setIHOLD_IRUN(1, 20, 0); |
|
|
|
m_motor[1].setMotorShaft(true); |
|
|
|
|
|
|
|