From bc2366cd8d267b2cd04c64e85a85214e33b13951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 4 Mar 2023 15:25:06 +0000 Subject: [PATCH 1/8] PFW-1503 Improve live Z babystep menu handling Fixes an issue with running first layer calibration twice in a row. Improvements: Now the Z baby step menu closes automatically when first layer calibration is done. No need to wait for a timeout or close the menu manually by setting a variable If the baby stepping menu is open, and suddenly the printer enters a state where baby stepping is not allowed. The printer will save the last value before closing the menu. When LcdCommands != Idle, don't dismiss the Z baby step menu. This saves 20B Change in memory: Flash: -130 bytes SRAM: 0 bytes --- Firmware/Marlin.h | 7 +++++++ Firmware/Marlin_main.cpp | 7 +++++++ Firmware/ultralcd.cpp | 25 ++++++++----------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index ac55a787428d..b7e0d6f8ef5e 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -365,6 +365,13 @@ extern bool printer_active(); //! I'd normally change this macro, but who knows what would happen in the MMU :) bool check_fsensor(); +//! Condition where Babystepping is allowed: +//! 1) Axis are trusted: Z-axis position must be known +//! 2) Not allowed during Homing (printer busy) +//! 3) Not allowed during Mesh Bed Leveling (printer busy) +//! 4) Allowed if there are queued blocks OR there is a print job running +bool BABYSTEP_ALLOWED(); + extern void calculate_extruder_multipliers(); // Similar to the default Arduino delay function, diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b82105d9072f..4080a4af5f0d 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -545,6 +545,13 @@ bool check_fsensor() { && e_active(); } +bool __attribute__((noinline)) BABYSTEP_ALLOWED() { + return (axis_known_position[Z_AXIS] + && !homing_flag && !mesh_bed_leveling_flag + && ( blocks_queued() || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) + ); +} + bool fans_check_enabled = true; #ifdef TMC2130 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index f327fbdc161c..0892fd1eb496 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -833,8 +833,6 @@ void lcd_commands() const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; - if(lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen - if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) @@ -879,7 +877,6 @@ void lcd_commands() break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); - menu_leaving = 1; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen break; case 1: lcd_setstatuspgm(MSG_WELCOME); @@ -2593,13 +2590,6 @@ static void lcd_move_z() { */ static void lcd_babystep_z() { - if (homing_flag || mesh_bed_leveling_flag) - { - // printer changed to a new state where live Z is forbidden - menu_back(); - return; - } - typedef struct { int8_t status; @@ -4638,7 +4628,7 @@ static void lcd_settings_menu() MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set); #endif //HAS_SECOND_SERIAL - if (!isPrintPaused && !homing_flag && !mesh_bed_leveling_flag) + if ( BABYSTEP_ALLOWED() ) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); #if (LANG_MODE != 0) @@ -5347,7 +5337,7 @@ static void lcd_main_menu() MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG - if ( ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag) { + if ( BABYSTEP_ALLOWED() ) { MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 } @@ -7467,13 +7457,11 @@ void menu_lcd_longpress_func(void) // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed - if ( (moves_planned() || IS_SD_PRINTING || usb_timer.running() )){ // long press as live-adj-z - if (( current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU ) // only allow live-adj-z up to 2mm of print height - && ( menu_menu == lcd_status_screen // and in listed menus... + if (BABYSTEP_ALLOWED()){ // long press as live-adj-z + if ( menu_menu == lcd_status_screen // and in listed menus... || menu_menu == lcd_main_menu || menu_menu == lcd_tune_menu || menu_menu == lcd_support_menu - ) ){ lcd_clear(); menu_submenu(lcd_babystep_z); @@ -7499,10 +7487,13 @@ void menu_lcd_longpress_func(void) } } +// Note: When lcd_commands_type is not LcdCommands::Idle +// we should ignore lcd_timeoutToStatus. Example use case is +// when running first layer calibration. static inline bool z_menu_expired() { return (menu_menu == lcd_babystep_z - && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)); + && (!BABYSTEP_ALLOWED() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); } static inline bool other_menu_expired() { From bb614f669d7bf9fc82d68862eb3fba5729c2d762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 4 Mar 2023 16:35:40 +0000 Subject: [PATCH 2/8] PFW-1503 Add additional check Add lcd_commands_type == LcdCommands::Layer1Cal just in case blocks_queued() is 0 for one instant between lcd_command steps Change in memory: Flash: +8 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4080a4af5f0d..06b371b9884f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -548,7 +548,7 @@ bool check_fsensor() { bool __attribute__((noinline)) BABYSTEP_ALLOWED() { return (axis_known_position[Z_AXIS] && !homing_flag && !mesh_bed_leveling_flag - && ( blocks_queued() || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) + && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) ); } From 09d918ce5d88bb1b79b0aaa8021a9cea1130290d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 12 Mar 2023 09:40:04 +0000 Subject: [PATCH 3/8] PFW-1503 Change BABYSTEP_ALLOWED to babystep_allowed I initially started with a preprocessor macro called BABYSTEP_ALLOWED, but now it is a function. It more common to use lower case for function names --- Firmware/Marlin.h | 2 +- Firmware/Marlin_main.cpp | 2 +- Firmware/ultralcd.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index b7e0d6f8ef5e..4205d082250c 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -370,7 +370,7 @@ bool check_fsensor(); //! 2) Not allowed during Homing (printer busy) //! 3) Not allowed during Mesh Bed Leveling (printer busy) //! 4) Allowed if there are queued blocks OR there is a print job running -bool BABYSTEP_ALLOWED(); +bool babystep_allowed(); extern void calculate_extruder_multipliers(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 06b371b9884f..67917a396f44 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -545,7 +545,7 @@ bool check_fsensor() { && e_active(); } -bool __attribute__((noinline)) BABYSTEP_ALLOWED() { +bool __attribute__((noinline)) babystep_allowed() { return (axis_known_position[Z_AXIS] && !homing_flag && !mesh_bed_leveling_flag && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 0892fd1eb496..553a96e1e0ed 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4628,7 +4628,7 @@ static void lcd_settings_menu() MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set); #endif //HAS_SECOND_SERIAL - if ( BABYSTEP_ALLOWED() ) + if ( babystep_allowed() ) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); #if (LANG_MODE != 0) @@ -5337,7 +5337,7 @@ static void lcd_main_menu() MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG - if ( BABYSTEP_ALLOWED() ) { + if ( babystep_allowed() ) { MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 } @@ -7457,7 +7457,7 @@ void menu_lcd_longpress_func(void) // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed - if (BABYSTEP_ALLOWED()){ // long press as live-adj-z + if (babystep_allowed()){ // long press as live-adj-z if ( menu_menu == lcd_status_screen // and in listed menus... || menu_menu == lcd_main_menu || menu_menu == lcd_tune_menu @@ -7493,7 +7493,7 @@ void menu_lcd_longpress_func(void) static inline bool z_menu_expired() { return (menu_menu == lcd_babystep_z - && (!BABYSTEP_ALLOWED() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); + && (!babystep_allowed() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); } static inline bool other_menu_expired() { From 59314a41c12d8cc4963629f999058f82062cd063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 12 Mar 2023 09:51:12 +0000 Subject: [PATCH 4/8] PFW-1503 only allow babystepping on the first couple of layers Change in memory: Flash: +28 bytes SRAM: 0 bytes --- Firmware/Marlin.h | 2 +- Firmware/Marlin_main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 4205d082250c..c4ac86a939f3 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -366,7 +366,7 @@ extern bool printer_active(); bool check_fsensor(); //! Condition where Babystepping is allowed: -//! 1) Axis are trusted: Z-axis position must be known +//! 1) Z-axis position is less than 2.0mm (only allowed during the first couple of layers) //! 2) Not allowed during Homing (printer busy) //! 3) Not allowed during Mesh Bed Leveling (printer busy) //! 4) Allowed if there are queued blocks OR there is a print job running diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 67917a396f44..12268663ce75 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -546,7 +546,7 @@ bool check_fsensor() { } bool __attribute__((noinline)) babystep_allowed() { - return (axis_known_position[Z_AXIS] + return ( (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) ); From 561d8599d29daa9acb0f68f0a2adec1a4bfac641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 12 Mar 2023 09:55:17 +0000 Subject: [PATCH 5/8] PFW-1503 drop {} for consistency --- Firmware/ultralcd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 553a96e1e0ed..3bb330bb0422 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5337,9 +5337,8 @@ static void lcd_main_menu() MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG - if ( babystep_allowed() ) { + if ( babystep_allowed() ) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 - } if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 From e40d8ebbcc68e213bd698d96024df2506a7331ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Mar 2023 12:15:44 +0000 Subject: [PATCH 6/8] Implement printJobOngoing() This makes the if statments a little bit more readable Change in memory: Flash: -88 bytes SRAM: 0 bytes --- Firmware/Filament_sensor.cpp | 6 ++---- Firmware/Marlin.h | 6 +++++- Firmware/Marlin_main.cpp | 13 ++++++++----- Firmware/fancheck.cpp | 2 +- Firmware/ultralcd.cpp | 8 ++++---- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Firmware/Filament_sensor.cpp b/Firmware/Filament_sensor.cpp index dbccf2760f85..9fb9c881c8d2 100644 --- a/Firmware/Filament_sensor.cpp +++ b/Firmware/Filament_sensor.cpp @@ -113,8 +113,7 @@ void Filament_sensor::triggerFilamentInserted() { && (! MMU2::mmu2.Enabled() ) // quick and dirty hack to prevent spurious runouts while the MMU is in charge && !( moves_planned() != 0 - || IS_SD_PRINTING - || usb_timer.running() + || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) @@ -131,8 +130,7 @@ void Filament_sensor::triggerFilamentRemoved() { && !saved_printing && ( moves_planned() != 0 - || IS_SD_PRINTING - || usb_timer.running() + || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index c4ac86a939f3..b7d37625550d 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -354,7 +354,11 @@ extern LongTimer safetyTimer; #define PRINT_PERCENT_DONE_INIT 0xff -extern bool printer_active(); +// Returns true if there is a print running. It does not matter if +// the print is paused, that still counts as a "running" print. +bool printJobOngoing(); + +bool printer_active(); //! Beware - mcode_in_progress is set as soon as the command gets really processed, //! which is not the same as posting the M600 command into the command queue diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 12268663ce75..1d71c3f014ab 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -525,9 +525,12 @@ void servo_init() #endif } +bool __attribute__((noinline)) printJobOngoing() { + return (IS_SD_PRINTING || usb_timer.running()); +} + bool __attribute__((noinline)) printer_active() { - return IS_SD_PRINTING - || usb_timer.running() + return printJobOngoing() || isPrintPaused || (custom_message_type == CustomMsg::TempCal) || saved_printing @@ -539,7 +542,7 @@ bool __attribute__((noinline)) printer_active() { // Currently only used in one place, allowed to be inlined bool check_fsensor() { - return (IS_SD_PRINTING || usb_timer.running()) + return printJobOngoing() && mcode_in_progress != 600 && !saved_printing && e_active(); @@ -548,7 +551,7 @@ bool check_fsensor() { bool __attribute__((noinline)) babystep_allowed() { return ( (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag - && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && (IS_SD_PRINTING || usb_timer.running()) )) + && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && printJobOngoing() )) ); } @@ -9574,7 +9577,7 @@ void ThermalStop(bool allow_recovery) Stopped = true; // Either pause or stop the print - if(allow_recovery && (IS_SD_PRINTING || usb_timer.running())) { + if(allow_recovery && printJobOngoing()) { if (!isPrintPaused) { lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); diff --git a/Firmware/fancheck.cpp b/Firmware/fancheck.cpp index 3bf2a6c1f273..d3f7e55d602a 100755 --- a/Firmware/fancheck.cpp +++ b/Firmware/fancheck.cpp @@ -85,7 +85,7 @@ void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; - if (IS_SD_PRINTING || usb_timer.running()) { + if (printJobOngoing()) { // A print is ongoing, pause the print normally if(!isPrintPaused) { if (usb_timer.running()) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 3bb330bb0422..7fb60f668356 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3495,7 +3495,7 @@ static void crash_mode_switch() { lcd_crash_detect_enable(); } - if (IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal)) menu_goto(lcd_tune_menu, 9, true, true); + if (printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal)) menu_goto(lcd_tune_menu, 9, true, true); else menu_goto(lcd_settings_menu, 9, true, true); } #endif //TMC2130 @@ -5371,7 +5371,7 @@ static void lcd_main_menu() } } } - if((IS_SD_PRINTING || usb_timer.running() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { + if((printJobOngoing() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef TEMP_MODEL @@ -5399,7 +5399,7 @@ static void lcd_main_menu() } #endif //SDSUPPORT - if(!isPrintPaused && !IS_SD_PRINTING && !usb_timer.running() && (lcd_commands_type != LcdCommands::Layer1Cal)) { + if(!isPrintPaused && !printJobOngoing() && (lcd_commands_type != LcdCommands::Layer1Cal)) { if (!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); @@ -5409,7 +5409,7 @@ static void lcd_main_menu() } } - if ( ! ( IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal || Stopped) ) ) { + if ( ! ( printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal || Stopped) ) ) { if (MMU2::mmu2.Enabled()) { MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), mmu_load_filament_menu); MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu);////MSG_LOAD_TO_NOZZLE c=18 From 942021cb2bc871a1b84d0f2c3025fdc23d322df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Mar 2023 12:47:40 +0000 Subject: [PATCH 7/8] PFW-1503 Fix an issue where the menu is dismissed in First layer calibraiton When the extruder lifts up after completing the Purge line, the baby stepping is not allowed for a short time. This dismisses the menu. We don't want this behavior, so only apply the Z-axis requirement when printing. Change in memory: Flash: +8 bytes SRAM: 0 bytes --- Firmware/Marlin.h | 4 +++- Firmware/Marlin_main.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index b7d37625550d..1cef467d6709 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -373,7 +373,9 @@ bool check_fsensor(); //! 1) Z-axis position is less than 2.0mm (only allowed during the first couple of layers) //! 2) Not allowed during Homing (printer busy) //! 3) Not allowed during Mesh Bed Leveling (printer busy) -//! 4) Allowed if there are queued blocks OR there is a print job running +//! 4) Allowed if: +//! - First Layer Calibration is running +//! - OR there are queued blocks, printJob is running and it's not paused, and Z-axis position is less than 2.0mm (only allowed during the first couple of layers) bool babystep_allowed(); extern void calculate_extruder_multipliers(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 1d71c3f014ab..8b1562955682 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -549,9 +549,9 @@ bool check_fsensor() { } bool __attribute__((noinline)) babystep_allowed() { - return ( (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) - && !homing_flag && !mesh_bed_leveling_flag - && ( blocks_queued() || lcd_commands_type == LcdCommands::Layer1Cal || ( !isPrintPaused && printJobOngoing() )) + return ( !homing_flag + && !mesh_bed_leveling_flag + && ( lcd_commands_type == LcdCommands::Layer1Cal || ( blocks_queued() && !isPrintPaused && printJobOngoing() && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU))) ); } From 178c1f4aa61e74521bed849ac492abf96c2a1191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Mon, 20 Mar 2023 13:57:20 +0000 Subject: [PATCH 8/8] Header cleanup --- Firmware/Filament_sensor.cpp | 1 - Firmware/fancheck.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/Firmware/Filament_sensor.cpp b/Firmware/Filament_sensor.cpp index 9fb9c881c8d2..3b373736d9e2 100644 --- a/Firmware/Filament_sensor.cpp +++ b/Firmware/Filament_sensor.cpp @@ -4,7 +4,6 @@ #include "Filament_sensor.h" #include "Timer.h" -#include "cardreader.h" #include "eeprom.h" #include "menu.h" #include "planner.h" diff --git a/Firmware/fancheck.cpp b/Firmware/fancheck.cpp index d3f7e55d602a..4e6ae2741a68 100755 --- a/Firmware/fancheck.cpp +++ b/Firmware/fancheck.cpp @@ -1,6 +1,5 @@ // fan control and check #include "fancheck.h" -#include "cardreader.h" #include "ultralcd.h" #include "sound.h" #include "messages.h"