Don't render message when printer is idle

Guard the lcd_display_message_fullscreen_P call by blocks_queued(). If there are no planned moves, there is no need to render this message, it creates a weird LCD draw noticable by the user.

Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-04-23 09:43:23 +00:00 committed by Alex Voinea
parent 9de2cbfe8e
commit 5b7266fdf1
No known key found for this signature in database
GPG Key ID: 37EDFD565CB33BAD
1 changed files with 11 additions and 8 deletions

View File

@ -3377,15 +3377,18 @@ static void lcd_silent_mode_set() {
}
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
#ifdef TMC2130
lcd_display_message_fullscreen_P(_i("Mode change in progress..."));////MSG_MODE_CHANGE_IN_PROGRESS c=20 r=3
// Wait until the planner queue is drained and the stepper routine achieves
// an idle state.
st_synchronize();
if (blocks_queued())
{
lcd_display_message_fullscreen_P(_i("Mode change in progress..."));////MSG_MODE_CHANGE_IN_PROGRESS c=20 r=3
// Wait until the planner queue is drained and the stepper routine achieves
// an idle state.
st_synchronize();
}
tmc2130_wait_standstill_xy(1000);
cli();
tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL;
update_mode_profile();
tmc2130_init(TMCInitParams(false, FarmOrUserECool()));
cli();
tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL;
update_mode_profile();
tmc2130_init(TMCInitParams(false, FarmOrUserECool()));
// We may have missed a stepper timer interrupt due to the time spent in tmc2130_init.
// Be safe than sorry, reset the stepper timer before re-enabling interrupts.
st_reset_timer();