diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 92e64f26be3ee25f384012bb3c230ff984abab63..9a378f589a085894532aaf7f46c7f8c20df5f79e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1128,17 +1128,12 @@ */ //#define EXTENDED_CAPABILITIES_REPORT - /** - * Double Clicking of LCD Panel's Encoder Wheel while at the Status Screen will jump - * to the Z-BabyStepping menu. + * Double-click the Encoder button on the Status Screen for Z Babystepping. */ -//#define DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING -#define DOUBLE_CLICK_TIME_WINDOW 1250 // How quickly the double click must be done in miliseconds. - // Please notice this time must be a little bit longer than what - // is actually desired because there is some latency in detecting a - // change in LCD Panel Button Status. - +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. /** * Volumetric extrusion default state diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 4f2572e4a277c1d87c1754e732249979677ff8e3..e629b7f48c7e277395d56851a8bbb0de9f001fc9 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 96775c9d86598af582cc07d5c7113d19b0431c7d..010d2c018d810dc493128b9ac1564a3a9aa51dce 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 67981af95807d193f5ad093bd55965e1e39f6055..1877ace1bc6b99d4f238252fe2ed62337f544244 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index e7caa3f3395ec85cdd54c5cf3f9d2eeaf3f12c5c..d26300e0e75dab927451a52ed2774321c9a27755 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -1108,6 +1108,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 2cdc1365a1f1662f8291eb956ad4b252c08c54f7..aa4db9c689810752b13d283976d3a5ee6cfc678f 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -1138,6 +1138,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index a0889024b25f5d81df0fee531116cf8052af5d4e..bb2e1e49e5a87835dce686ec55140db74da928ac 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 843c2b042840b8378861e02f11e9e2f57b8a66b3..f8eef6f569f9c099227ed9c501eee4cd129a4924 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 68304e71217c757abd438092e3fcc93931be063a..892d2edebc61d85d780e3ada250212e39fa3dfec 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 8e42b827195af26e126058f2dd37c1d22a191759..86d2737535bad112b3a875c0767a3706e80c876c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -1133,6 +1133,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 67981af95807d193f5ad093bd55965e1e39f6055..1877ace1bc6b99d4f238252fe2ed62337f544244 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index d362d727e9587db4a7a6234f1f256b7030cf7ec1..5d75ba3cf504bd6e82dffcd22ffaff37eb914ba5 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -1127,6 +1127,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index d362d727e9587db4a7a6234f1f256b7030cf7ec1..5d75ba3cf504bd6e82dffcd22ffaff37eb914ba5 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -1127,6 +1127,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 61c38d38aae9c30a14306e39a0d782d08200d380..9f3a9f3d2f76484cdb14f454f454701e847fcbec 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -1132,6 +1132,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 9584ae341107c2bf4bfdc31cc1a2b6ed49c055cd..78a52f8323fca0af221b1391e28c389451ebb62a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -1127,6 +1127,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 184dc0dac0ad4eb326917bffc5e70b31c2570f9b..87de6007b3b44bd6e2184d8aedc7f034d1468f05 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 2092b3b60fd31395005b5946d1a300d4530280b7..a259f420a862731d68a935a51639cfc0e9fe7545 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -1125,6 +1125,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Double-click the Encoder button on the Status Screen for Z Babystepping. + */ +//#define DOUBLECLICK_FOR_Z_BABYSTEPPING +#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: You may need to add extra time to mitigate controller latency. + /** * Volumetric extrusion default state * Activate to make volumetric extrusion the default method, diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c0facef97dc3513a0a80e052b524533a677dabbe..b5331e389bb8d025ec4846fc94b29cd2d7e0cc97 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -51,7 +51,6 @@ int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2 #if ENABLED(BABYSTEPPING) long babysteps_done = 0; - millis_t status_screen_click_time = 0; static void lcd_babystep_z(); #endif @@ -417,22 +416,20 @@ uint16_t max_display_update_time = 0; * General function to go directly to a screen */ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) { - #ifdef DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING - #if ENABLED(BABYSTEPPING) - if (currentScreen==lcd_status_screen && screen==lcd_main_menu) // We are in leaving the status screen to goto the main_menu - status_screen_click_time = millis(); // screen. Mark the time so we know how quick the user is - // pressing buttons. - if (currentScreen==lcd_main_menu) { - if ( screen==lcd_status_screen && status_screen_click_time+DOUBLE_CLICK_TIME_WINDOW>millis() ) { - lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - status_screen_click_time = 0; - lcd_babystep_z(); - return; - } - } - #endif - #endif if (currentScreen != screen) { + + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) + static millis_t doubleclick_expire_ms = 0; + // Going to lcd_main_menu from status screen? Remember first click time. + // Going back to status screen within a very short time? Go to Z babystepping. + if (screen == lcd_main_menu) { + if (currentScreen == lcd_status_screen) + doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; + } + else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms)) + screen = lcd_babystep_z; + #endif + currentScreen = screen; encoderPosition = encoder; if (screen == lcd_status_screen) {