Skip to content

Commit

Permalink
M850 shows active sheet
Browse files Browse the repository at this point in the history
Prevent sheet being active if not initialized
  • Loading branch information
3d-gussner committed Jan 12, 2024
1 parent 8d50d29 commit 106f56e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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')){
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 106f56e

Please sign in to comment.