Don't show Pause/Stop menus while processing T-codes

PFW-1449

Change in memory:
Flash: +18 bytes
SRAM: +1 bytes
This commit is contained in:
Guðni Már Gilbert 2023-02-11 16:29:21 +00:00 committed by DRracer
parent 504099bd6c
commit b63f5433df
3 changed files with 6 additions and 2 deletions

View File

@ -304,6 +304,7 @@ extern uint8_t host_keepalive_interval;
extern unsigned long starttime;
extern unsigned long stoptime;
extern ShortTimer usb_timer;
extern bool processing_tcode;
extern bool homing_flag;
extern bool loading_flag;
extern unsigned long total_filament_used;

View File

@ -312,6 +312,7 @@ unsigned long stoptime=0;
ShortTimer usb_timer;
bool Stopped=false;
bool processing_tcode; // Helper variable to block certain functions while T-code is being processed
#if NUM_SERVOS > 0
Servo servos[NUM_SERVOS];
@ -8535,7 +8536,9 @@ Sigma_Exit:
*/
else if(*CMDBUFFER_CURRENT_STRING == 'T') {
strchr_pointer = CMDBUFFER_CURRENT_STRING;
processing_tcode = true;
TCodes(strchr_pointer, code_value_uint8());
processing_tcode = false;
} // end if(code_seen('T')) (end of T codes)
/*!
#### End of T-Codes

View File

@ -5376,7 +5376,7 @@ static void lcd_main_menu()
MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT c=18
}
if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) {
if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused && !processing_tcode) {
if (usb_timer.running()) {
MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);
} else if (IS_SD_PRINTING) {
@ -5398,7 +5398,7 @@ static void lcd_main_menu()
}
}
}
if((IS_SD_PRINTING || usb_timer.running() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) {
if((IS_SD_PRINTING || usb_timer.running() || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) {
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
}
#ifdef TEMP_MODEL