Merge pull request #3134 from wavexx/fix_partial_redraw2

Redraw "Preheating to load" in full when modified by other actions
This commit is contained in:
DRracer 2021-06-21 06:42:13 +02:00 committed by GitHub
commit 5bb8bb2ccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 6 deletions

View File

@ -2201,14 +2201,21 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
} }
else else
{ {
if (!bFilamentWaitingFlag) if (!bFilamentWaitingFlag || lcd_draw_update)
{ {
// First run after the filament preheat selection: // First entry from another menu OR first run after the filament preheat selection. Use
// setup the fixed LCD parts and raise Z as we wait // bFilamentWaitingFlag to distinguish: this flag is reset exactly once when entering
// the menu and is used to raise the carriage *once*. In other cases, the LCD has been
// modified elsewhere and needs to be redrawn in full.
// reset bFilamentWaitingFlag immediately to avoid re-entry from raise_z_above()!
bool once = !bFilamentWaitingFlag;
bFilamentWaitingFlag = true; bFilamentWaitingFlag = true;
lcd_clear(); // also force-enable lcd_draw_update (might be 0 when called from outside a menu)
lcd_draw_update = 1; lcd_draw_update = 1;
lcd_clear();
lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); ////MSG_CANCEL lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); ////MSG_CANCEL
lcd_set_cursor(0, 1); lcd_set_cursor(0, 1);
@ -2218,12 +2225,12 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
case FilamentAction::AutoLoad: case FilamentAction::AutoLoad:
case FilamentAction::MmuLoad: case FilamentAction::MmuLoad:
lcd_puts_P(_i("Preheating to load")); ////MSG_PREHEATING_TO_LOAD c=20 lcd_puts_P(_i("Preheating to load")); ////MSG_PREHEATING_TO_LOAD c=20
raise_z_above(MIN_Z_FOR_LOAD); if (once) raise_z_above(MIN_Z_FOR_LOAD);
break; break;
case FilamentAction::UnLoad: case FilamentAction::UnLoad:
case FilamentAction::MmuUnLoad: case FilamentAction::MmuUnLoad:
lcd_puts_P(_i("Preheating to unload")); ////MSG_PREHEATING_TO_UNLOAD c=20 lcd_puts_P(_i("Preheating to unload")); ////MSG_PREHEATING_TO_UNLOAD c=20
raise_z_above(MIN_Z_FOR_UNLOAD); if (once) raise_z_above(MIN_Z_FOR_UNLOAD);
break; break;
case FilamentAction::MmuEject: case FilamentAction::MmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_PREHEATING_TO_EJECT c=20 lcd_puts_P(_i("Preheating to eject")); ////MSG_PREHEATING_TO_EJECT c=20