Optimise lcd_status_screen

Saves 20 bytes of flash
This commit is contained in:
Guðni Már Gilbert 2022-04-30 14:12:24 +00:00
parent 33a0a58810
commit f6fd91a235
3 changed files with 5 additions and 10 deletions

View File

@ -638,7 +638,6 @@ uint8_t lcd_button_pressed = 0;
uint8_t lcd_update_enabled = 1; uint8_t lcd_update_enabled = 1;
uint32_t lcd_next_update_millis = 0; uint32_t lcd_next_update_millis = 0;
uint8_t lcd_status_update_delay = 0;

View File

@ -107,8 +107,6 @@ extern LongTimer lcd_timeoutToStatus;
extern uint32_t lcd_next_update_millis; extern uint32_t lcd_next_update_millis;
extern uint8_t lcd_status_update_delay;
extern lcd_longpress_func_t lcd_longpress_func; extern lcd_longpress_func_t lcd_longpress_func;
extern bool lcd_longpress_trigger; extern bool lcd_longpress_trigger;

View File

@ -758,6 +758,7 @@ void lcdui_print_status_screen(void)
// Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent // Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent
void lcd_status_screen() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") void lcd_status_screen() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
{ {
static uint8_t lcd_status_update_delay = 0;
#ifdef ULTIPANEL_FEEDMULTIPLY #ifdef ULTIPANEL_FEEDMULTIPLY
// Dead zone at 100% feedrate // Dead zone at 100% feedrate
if ((feedmultiply < 100 && (feedmultiply + int(lcd_encoder)) > 100) || if ((feedmultiply < 100 && (feedmultiply + int(lcd_encoder)) > 100) ||
@ -791,11 +792,9 @@ void lcd_status_screen() // NOT static due to using ins
if (lcd_status_update_delay) if (lcd_status_update_delay)
lcd_status_update_delay--; lcd_status_update_delay--;
else else
lcd_draw_update = 1; { // Redraw the main screen every second (see LCD_UPDATE_INTERVAL).
// This is easier then trying keep track of all things that change on the screen
lcd_status_update_delay = 10;
if (lcd_draw_update)
{
ReInitLCD++; ReInitLCD++;
if (ReInitLCD == 30) if (ReInitLCD == 30)
{ {
@ -832,10 +831,9 @@ void lcd_status_screen() // NOT static due to using ins
} }
} // end of farm_mode } // end of farm_mode
lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
if (lcd_commands_type != LcdCommands::Idle) if (lcd_commands_type != LcdCommands::Idle)
lcd_commands(); lcd_commands();
} // end of lcd_draw_update }
bool current_click = LCD_CLICKED; bool current_click = LCD_CLICKED;