From 106f56e276823100685ed3dd48e2274639d1af70 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Fri, 12 Jan 2024 13:34:01 +0100 Subject: [PATCH] M850 shows active sheet Prevent sheet being active if not initialized --- Firmware/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 74ac22d060..35a178f5fa 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7880,7 +7880,7 @@ SERIAL_PROTOCOLPGM("\n\n"); Get and Set Sheet parameters #### Usage - M25 [ S | Z | L | B | P | A ] + M850 [ S | Z | L | B | P | A ] #### Parameters - `S` - Sheet id [0-7] @@ -7910,7 +7910,7 @@ SERIAL_PROTOCOLPGM("\n\n"); break; // invalid sheet ID } } else { - break; + iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); } if (code_seen('Z')){ @@ -7967,7 +7967,7 @@ SERIAL_PROTOCOLPGM("\n\n"); if (code_seen('A')) { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); - if(bIsActive) eeprom_update_byte(&EEPROM_Sheets_base->active_sheet, iSel); + if(bIsActive && eeprom_is_sheet_initialized(iSel)) eeprom_update_byte(&EEPROM_Sheets_base->active_sheet, iSel); } else {