From 7fe07dc4ce0f34a1f04ff1c050c6b94fd4c3976a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Nov 2023 16:05:31 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20runout=20state=20in=20menu?= =?UTF-8?q?=20(#26394)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26386 --- Marlin/src/lcd/menu/menu_filament.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 073ffc1838..46ebf85ba4 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -250,6 +250,12 @@ static FSTR_P pause_header() { }while(0) void menu_pause_option() { + #if HAS_FILAMENT_SENSOR + const bool still_out = runout.filament_ran_out; + #else + constexpr bool still_out = false; + #endif + START_MENU(); #if LCD_HEIGHT > 2 STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); @@ -257,11 +263,8 @@ void menu_pause_option() { ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_PURGE, []{ pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; }); #if HAS_FILAMENT_SENSOR - const bool still_out = runout.filament_ran_out; if (still_out) EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); - #else - constexpr bool still_out = false; #endif if (!still_out)