diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 40b59587b6..b885ba5bc3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1346,7 +1346,9 @@ #if ENABLED(ENCODER_RATE_MULTIPLIER) #define ENCODER_5X_STEPS_PER_SEC 30 #define ENCODER_10X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 10x speed - #define ENCODER_100X_STEPS_PER_SEC 130 // (steps/s) Encoder rate for 100x speed + #if DISABLED(DWIN_MARLINUI_PORTRAIT) + #define ENCODER_100X_STEPS_PER_SEC 130 // (steps/s) Encoder rate for 100x speed + #endif #endif // Play a beep when the feedrate is changed from the Status Screen diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index edfaf60aae..dcd1af2bb6 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -139,8 +139,10 @@ EncoderState Encoder_ReceiveAnalyze() { // Note that the rate is always calculated between two passes through the // loop and that the abs of the temp_diff value is tracked. const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000; - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; + #if defined(ENCODER_100X_STEPS_PER_SEC) + if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; + #endif + if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; #if ENCODER_5X_STEPS_PER_SEC else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5; #endif diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 8bf0e71d3c..353c593ccf 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1026,8 +1026,10 @@ void MarlinUI::init() { // loop and that the abs of the encoderDiff value is tracked. const float encoderStepRate = encoderMovementSteps / float(ms - lastEncoderMovementMillis) * 1000; - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; + #if defined(ENCODER_100X_STEPS_PER_SEC) + if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; + #endif + if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; // Enable to output the encoder steps per second value //#define ENCODER_RATE_MULTIPLIER_DEBUG