diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3b164a4f6..2ab659513 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -862,6 +862,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 57292b218..8729180d0 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -845,6 +845,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index ba1f9e8b3..43f838510 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -843,6 +843,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 4bf40859f..f25cf1e7b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -854,6 +854,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 285ffb536..c83f6d059 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -856,6 +856,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 17290bc87..08fcda927 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -879,6 +879,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 22d776619..8935f8399 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -862,6 +862,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 42a086495..c00ce84c3 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -857,6 +857,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4bc60ac2a..6c0b2d29d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -870,6 +870,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 7b52693b9..d957f3cd7 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -883,6 +883,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // #define ENCODER_STEPS_PER_MENU_ITEM 1 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index aecbdc75d..0c0ab8e04 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -854,6 +854,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 5eb8301be..36a225549 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -862,6 +862,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 6cbb21ae5..4a54a3d44 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -991,6 +991,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index e6f049528..5230887e1 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -991,6 +991,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index e55d2941e..b72d45d13 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -995,6 +995,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 61c6eee00..32efdb318 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -988,6 +988,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 37240d136..dfee03c1f 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -996,6 +996,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 3d21ed402..12895c851 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -865,6 +865,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 32bfc9cd0..0e9511631 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -856,6 +856,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ENCODER_STEPS_PER_MENU_ITEM 5 +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + // // This option reverses the encoder direction for navigating LCD menus. // diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4584647fd..401b1fab3 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2466,9 +2466,15 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } GET_BUTTON_STATES(buttons); #endif //!NEWPANEL - #if ENABLED(REVERSE_MENU_DIRECTION) + #if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION) + #define ENCODER_DIFF_CW (encoderDiff -= encoderDirection) + #define ENCODER_DIFF_CCW (encoderDiff += encoderDirection) + #elif ENABLED(REVERSE_MENU_DIRECTION) #define ENCODER_DIFF_CW (encoderDiff += encoderDirection) #define ENCODER_DIFF_CCW (encoderDiff -= encoderDirection) + #elif ENABLED(REVERSE_ENCODER_DIRECTION) + #define ENCODER_DIFF_CW (encoderDiff--) + #define ENCODER_DIFF_CCW (encoderDiff++) #else #define ENCODER_DIFF_CW (encoderDiff++) #define ENCODER_DIFF_CCW (encoderDiff--)