From f936df950701f92e32b2564f2031c7b7c6ad0438 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Apr 2016 14:06:52 -0700 Subject: [PATCH] Small cleanup of feedrate dead-zone --- Marlin/ultralcd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 746c3002db..667f3f32de 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -432,13 +432,13 @@ static void lcd_status_screen() { } #if ENABLED(ULTIPANEL_FEEDMULTIPLY) + int new_frm = feedrate_multiplier + int(encoderPosition); // Dead zone at 100% feedrate - if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) || - (feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) { - encoderPosition = 0; + if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) { feedrate_multiplier = 100; + encoderPosition = 0; } - if (feedrate_multiplier == 100) { + else if (feedrate_multiplier == 100) { if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { feedrate_multiplier += int(encoderPosition) - (ENCODER_FEEDRATE_DEADZONE); encoderPosition = 0; @@ -449,7 +449,7 @@ static void lcd_status_screen() { } } else { - feedrate_multiplier += int(encoderPosition); + feedrate_multiplier = new_frm; encoderPosition = 0; } #endif // ULTIPANEL_FEEDMULTIPLY