From 6473e5a41d097c4af5247cd96a6b35a9a47ca11c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 7 Jun 2024 09:28:34 +0800 Subject: [PATCH] update --- components/tmc/ic/ztmc5130.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tmc/ic/ztmc5130.cpp b/components/tmc/ic/ztmc5130.cpp index ad72830..b279d5e 100644 --- a/components/tmc/ic/ztmc5130.cpp +++ b/components/tmc/ic/ztmc5130.cpp @@ -201,11 +201,11 @@ void TMC51X0::moveTo(int32_t position, uint32_t velocityMax) { void TMC51X0::moveToEnd(int32_t direction, uint32_t velocityMax) { if (direction > 0) { writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); - writeInt(TMC5130_VMAX, velocityMax); + writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); writeInt(TMC5130_XTARGET, INT32_MAX); } else { writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); - writeInt(TMC5130_VMAX, velocityMax); + writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); writeInt(TMC5130_XTARGET, INT32_MIN); } }