From 95878df30d737fd08f337491f7e19332fe7ac5ac Mon Sep 17 00:00:00 2001
From: narno2202 <130909513+narno2202@users.noreply.github.com>
Date: Sun, 31 Dec 2023 22:00:57 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20homing=20with=20FT=5FMOTIO?=
 =?UTF-8?q?N=20(#26595)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/module/ft_motion.cpp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp
index 0e1ade69f0f..ba1361f922b 100644
--- a/Marlin/src/module/ft_motion.cpp
+++ b/Marlin/src/module/ft_motion.cpp
@@ -501,11 +501,13 @@ void FTMotion::loadBlockData(block_t * const current_block) {
 
   ratio = moveDist * oneOverLength;
 
-  /* Keep for comprehension
   const float spm = totalLength / current_block->step_event_count;  // (steps/mm) Distance for each step
-              f_s = spm * current_block->initial_rate,  // (steps/s) Start feedrate
-              f_e = spm * current_block->final_rate;    // (steps/s) End feedrate
 
+  f_s = spm * current_block->initial_rate;              // (steps/s) Start feedrate
+
+  const float f_e = spm * current_block->final_rate;    // (steps/s) End feedrate
+
+  /* Keep for comprehension
   const float a = current_block->acceleration,          // (mm/s^2) Same magnitude for acceleration or deceleration
               oneby2a = 1.0f / (2.0f * a),              // (s/mm) Time to accelerate or decelerate one mm (i.e., oneby2a * 2
               oneby2d = -oneby2a;                       // (s/mm) Time to accelerate or decelerate one mm (i.e., oneby2a * 2
@@ -527,10 +529,6 @@ void FTMotion::loadBlockData(block_t * const current_block) {
               T3 = (F_n - f_e) / a;                     // (s) Decel Time = difference in feedrate over acceleration
   */
 
-  const float spm = totalLength / current_block->step_event_count,
-              f_s = spm * current_block->initial_rate,
-              f_e = spm * current_block->final_rate;
-
   const float accel = current_block->acceleration,
               oneOverAccel = 1.0f / accel;