Speedup sreen update delay
Speedup sreen update delay and correct a comment. A module division by 10 is slooooow. (powers of 2 are fast - but then you can AND a bitmask with the same result)
This commit is contained in:
parent
b422e39016
commit
0c4d885d5b
|
@ -282,7 +282,6 @@ menuPosition menu_history[10];
|
|||
uint8_t menu_history_depth = 0;
|
||||
|
||||
millis_t next_lcd_update_ms;
|
||||
uint8_t lcd_status_update_delay;
|
||||
bool ignore_click = false;
|
||||
bool wait_for_unclick;
|
||||
bool defer_return_to_status = false;
|
||||
|
@ -2248,9 +2247,13 @@ void lcd_update() {
|
|||
}
|
||||
#endif //ULTIPANEL
|
||||
|
||||
// Simply redraw the Info Screen 10 times a second
|
||||
if (currentMenu == lcd_status_screen && !(++lcd_status_update_delay % 10))
|
||||
// Here we arrive every ~100ms when ideling often enough.
|
||||
// Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
|
||||
static int8_t lcd_status_update_delay = 1; // first update one loop delayed
|
||||
if (currentMenu == lcd_status_screen && !lcd_status_update_delay--) {
|
||||
lcd_status_update_delay = 9;
|
||||
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
||||
}
|
||||
|
||||
if (lcdDrawUpdate) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue