From 6f8605bc63cd0060b21efcbe52ea3bf011374300 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Mon, 12 Mar 2018 13:16:33 -0600 Subject: [PATCH] Fix to Hibiscus LCD timeout (T1822) - LCD will now properly timeout after the user leaves the move axis screen. --- Marlin/Conditionals_LulzBot.h | 7 ++++++- Marlin/ultralcd.cpp | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Marlin/Conditionals_LulzBot.h b/Marlin/Conditionals_LulzBot.h index 8bb45dd13..bb3a65346 100644 --- a/Marlin/Conditionals_LulzBot.h +++ b/Marlin/Conditionals_LulzBot.h @@ -13,7 +13,7 @@ * got disabled. */ -#define LULZBOT_FW_VERSION ".16" // Change this with each update +#define LULZBOT_FW_VERSION ".17" // Change this with each update #if ( \ !defined(LULZBOT_Gladiola_Mini) && \ @@ -269,6 +269,11 @@ // Fix for bug where the LCD is not being properly cleared at startup #define LULZBOT_LCD_CLEAR_WORKAROUND +// Fix for bug where going to the Move Axis screen causes the menu +// not to timeout. This has been reported upstream: +// https://github.com/MarlinFirmware/Marlin/issues/10085 +#define LULZBOT_MOVE_AXIS_LCD_TIMER_WORKAROUND + /************************* EXPERIMENTAL FEATURES ******************************/ #if defined(LULZBOT_USE_EXPERIMENTAL_FEATURES) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c060e8d95..83ad88ba0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2963,7 +2963,11 @@ void kill_screen(const char* lcd_msg) { */ void _lcd_move_xyz(const char* name, AxisEnum axis) { - if (lcd_clicked) { return lcd_goto_previous_menu(); } + #if defined(LULZBOT_MOVE_AXIS_LCD_TIMER_WORKAROUND) + if (lcd_clicked) { return lcd_goto_previous_menu_no_defer(); } + #else + if (lcd_clicked) { return lcd_goto_previous_menu(); } + #endif ENCODER_DIRECTION_NORMAL(); if (encoderPosition && !processing_manual_move) { refresh_cmd_timeout(); @@ -3048,7 +3052,11 @@ void kill_screen(const char* lcd_msg) { int8_t eindex=-1 #endif ) { - if (lcd_clicked) { return lcd_goto_previous_menu(); } + #if defined(LULZBOT_MOVE_AXIS_LCD_TIMER_WORKAROUND) + if (lcd_clicked) { return lcd_goto_previous_menu_no_defer(); } + #else + if (lcd_clicked) { return lcd_goto_previous_menu(); } + #endif ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { if (!processing_manual_move) { @@ -4610,7 +4618,11 @@ void kill_screen(const char* lcd_msg) { * Menu actions * */ - void _menu_action_back() { lcd_goto_previous_menu(); } + #if defined(LULZBOT_MOVE_AXIS_LCD_TIMER_WORKAROUND) + void _menu_action_back() {lcd_goto_previous_menu_no_defer(); } + #else + void _menu_action_back() {lcd_goto_previous_menu(); } + #endif void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } void menu_action_function(screenFunc_t func) { (*func)(); }