|
|
@ -199,14 +199,15 @@ void TMC51X0::moveTo(int32_t position, uint32_t velocityMax) { |
|
|
|
writeInt(TMC5130_XTARGET, position); |
|
|
|
} |
|
|
|
void TMC51X0::moveToEnd(int32_t direction, uint32_t velocityMax) { |
|
|
|
if (direction > 0) { |
|
|
|
ZLOGI("TMC5130", "moveToEnd %d %d", direction, velocityMax); |
|
|
|
if (direction >= 0) { |
|
|
|
writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); |
|
|
|
writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); |
|
|
|
writeInt(TMC5130_XTARGET, INT32_MAX); |
|
|
|
writeInt(TMC5130_XTARGET, INT32_MAX / 2 - 1000); |
|
|
|
} else { |
|
|
|
writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); |
|
|
|
writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); |
|
|
|
writeInt(TMC5130_XTARGET, INT32_MIN); |
|
|
|
writeInt(TMC5130_XTARGET, INT32_MIN / 2 + 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|