Do not create static object in global function. Saves 8B RAM and 14B flash, because there is no need to guard constructor against concurrent calls.

This commit is contained in:
Marek Bel 2018-06-05 17:47:18 +02:00
parent b71a29ad96
commit 5f033d5a1a

View file

@ -174,6 +174,7 @@ unsigned long display_time; //just timer for showing pid finished message on lcd
float pid_temp = DEFAULT_PID_TEMP;
bool long_press_active = false;
static ShortTimer longPressTimer;
unsigned long button_blanking_time = millis();
bool button_pressed = false;
@ -7703,7 +7704,6 @@ void lcd_buttons_update()
lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
if (millis() > button_blanking_time) {
button_blanking_time = millis() + BUTTON_BLANKING_TIME;
static ShortTimer longPressTimer;
if (button_pressed == false && long_press_active == false) {
longPressTimer.start();
button_pressed = true;