|
@@ -10,6 +10,7 @@
|
|
#include "stepper.h"
|
|
#include "stepper.h"
|
|
#include "ConfigurationStore.h"
|
|
#include "ConfigurationStore.h"
|
|
#include <string.h>
|
|
#include <string.h>
|
|
|
|
+#include "Timer.h"
|
|
|
|
|
|
#include "util.h"
|
|
#include "util.h"
|
|
#include "mesh_bed_leveling.h"
|
|
#include "mesh_bed_leveling.h"
|
|
@@ -177,10 +178,9 @@ float pid_temp = DEFAULT_PID_TEMP;
|
|
|
|
|
|
bool long_press_active = false;
|
|
bool long_press_active = false;
|
|
static ShortTimer longPressTimer;
|
|
static ShortTimer longPressTimer;
|
|
-static ShortTimer buttonBlanking;
|
|
|
|
|
|
+unsigned long button_blanking_time = millis();
|
|
bool button_pressed = false;
|
|
bool button_pressed = false;
|
|
|
|
|
|
-static bool forceMenuExpire = false;
|
|
|
|
bool menuExiting = false;
|
|
bool menuExiting = false;
|
|
|
|
|
|
#ifdef FILAMENT_LCD_DISPLAY
|
|
#ifdef FILAMENT_LCD_DISPLAY
|
|
@@ -944,7 +944,7 @@ void lcd_commands()
|
|
float extr = count_e(0.2, width, length);
|
|
float extr = count_e(0.2, width, length);
|
|
float extr_short_segment = count_e(0.2, width, width);
|
|
float extr_short_segment = count_e(0.2, width, width);
|
|
|
|
|
|
- if (lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
|
|
|
|
+ if (lcd_commands_step>1) lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
if (lcd_commands_step == 0)
|
|
if (lcd_commands_step == 0)
|
|
{
|
|
{
|
|
lcd_commands_step = 10;
|
|
lcd_commands_step = 10;
|
|
@@ -970,7 +970,7 @@ void lcd_commands()
|
|
}
|
|
}
|
|
if (lcd_commands_step == 9 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 9 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
enquecommand_P(PSTR("G1 Z0.250 F7200.000"));
|
|
enquecommand_P(PSTR("G1 Z0.250 F7200.000"));
|
|
enquecommand_P(PSTR("G1 X50.0 E80.0 F1000.0"));
|
|
enquecommand_P(PSTR("G1 X50.0 E80.0 F1000.0"));
|
|
enquecommand_P(PSTR("G1 X160.0 E20.0 F1000.0"));
|
|
enquecommand_P(PSTR("G1 X160.0 E20.0 F1000.0"));
|
|
@@ -994,7 +994,7 @@ void lcd_commands()
|
|
}
|
|
}
|
|
if (lcd_commands_step == 8 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
if (lcd_commands_step == 8 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
|
|
|
|
|
|
|
enquecommand_P(PSTR("G1 X50 Y155"));
|
|
enquecommand_P(PSTR("G1 X50 Y155"));
|
|
@@ -1019,7 +1019,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 7 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 7 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
strcpy(cmd1, "G1 X50 Y35 E");
|
|
strcpy(cmd1, "G1 X50 Y35 E");
|
|
strcat(cmd1, ftostr43(extr));
|
|
strcat(cmd1, ftostr43(extr));
|
|
enquecommand(cmd1);
|
|
enquecommand(cmd1);
|
|
@@ -1052,7 +1052,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 4; i < 8; i++) {
|
|
for (int i = 4; i < 8; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1081,7 +1081,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 8; i < 12; i++) {
|
|
for (int i = 8; i < 12; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1110,7 +1110,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 12; i < 16; i++) {
|
|
for (int i = 12; i < 16; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1139,7 +1139,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
enquecommand_P(PSTR("G1 E-0.07500 F2100.00000"));
|
|
enquecommand_P(PSTR("G1 E-0.07500 F2100.00000"));
|
|
enquecommand_P(PSTR("G4 S0"));
|
|
enquecommand_P(PSTR("G4 S0"));
|
|
enquecommand_P(PSTR("G1 E-4 F2100.00000"));
|
|
enquecommand_P(PSTR("G1 E-4 F2100.00000"));
|
|
@@ -1208,7 +1208,7 @@ void lcd_commands()
|
|
float length = 20 - width;
|
|
float length = 20 - width;
|
|
float extr = count_e(0.2, width, length);
|
|
float extr = count_e(0.2, width, length);
|
|
float extr_short_segment = count_e(0.2, width, width);
|
|
float extr_short_segment = count_e(0.2, width, width);
|
|
- if(lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
|
|
|
|
+ if(lcd_commands_step>1) lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
if (lcd_commands_step == 0)
|
|
if (lcd_commands_step == 0)
|
|
{
|
|
{
|
|
lcd_commands_step = 9;
|
|
lcd_commands_step = 9;
|
|
@@ -1245,7 +1245,7 @@ void lcd_commands()
|
|
}
|
|
}
|
|
if (lcd_commands_step == 7 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
if (lcd_commands_step == 7 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
|
|
|
|
|
|
|
//just opposite direction
|
|
//just opposite direction
|
|
@@ -1293,7 +1293,7 @@ void lcd_commands()
|
|
if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
|
|
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
for (int i = 0; i < 4; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
@@ -1323,7 +1323,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 4; i < 8; i++) {
|
|
for (int i = 4; i < 8; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1352,7 +1352,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 8; i < 12; i++) {
|
|
for (int i = 8; i < 12; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1381,7 +1381,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
for (int i = 12; i < 16; i++) {
|
|
for (int i = 12; i < 16; i++) {
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcpy(cmd1, "G1 X70 Y");
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
strcat(cmd1, ftostr32(35 - i*width * 2));
|
|
@@ -1410,7 +1410,7 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 2 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 2 && !blocks_queued() && cmd_buffer_empty())
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
enquecommand_P(PSTR("G1 E-0.07500 F2100.00000"));
|
|
enquecommand_P(PSTR("G1 E-0.07500 F2100.00000"));
|
|
enquecommand_P(PSTR("M107")); //turn off printer fan
|
|
enquecommand_P(PSTR("M107")); //turn off printer fan
|
|
enquecommand_P(PSTR("M104 S0")); // turn off temperature
|
|
enquecommand_P(PSTR("M104 S0")); // turn off temperature
|
|
@@ -1418,7 +1418,7 @@ void lcd_commands()
|
|
enquecommand_P(PSTR("G1 Z10 F1300.000"));
|
|
enquecommand_P(PSTR("G1 Z10 F1300.000"));
|
|
enquecommand_P(PSTR("G1 X10 Y180 F4000")); //home X axis
|
|
enquecommand_P(PSTR("G1 X10 Y180 F4000")); //home X axis
|
|
enquecommand_P(PSTR("M84"));// disable motors
|
|
enquecommand_P(PSTR("M84"));// disable motors
|
|
- forceMenuExpire = true; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() - 1; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
lcd_commands_step = 1;
|
|
lcd_commands_step = 1;
|
|
}
|
|
}
|
|
if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
|
|
if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
|
|
@@ -2482,8 +2482,8 @@ static void lcd_menu_xyz_skew()
|
|
//|01234567890123456789|
|
|
//|01234567890123456789|
|
|
//|Measured skew: N/A |
|
|
//|Measured skew: N/A |
|
|
//|--------------------|
|
|
//|--------------------|
|
|
-//|Slight skew: 0.12�|
|
|
|
|
-//|Severe skew: 0.25�|
|
|
|
|
|
|
+//|Slight skew: 0.12°|
|
|
|
|
+//|Severe skew: 0.25°|
|
|
//----------------------
|
|
//----------------------
|
|
float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
lcd_printf_P(_N(
|
|
lcd_printf_P(_N(
|
|
@@ -2591,7 +2591,7 @@ static void _lcd_babystep(int axis, const char *msg)
|
|
//SERIAL_ECHO("Z baby step: ");
|
|
//SERIAL_ECHO("Z baby step: ");
|
|
//SERIAL_ECHO(menuData.babyStep.babystepMem[2]);
|
|
//SERIAL_ECHO(menuData.babyStep.babystepMem[2]);
|
|
// Wait 90 seconds before closing the live adjust dialog.
|
|
// Wait 90 seconds before closing the live adjust dialog.
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + 90000;
|
|
}
|
|
}
|
|
|
|
|
|
if (encoderPosition != 0)
|
|
if (encoderPosition != 0)
|
|
@@ -3898,7 +3898,7 @@ void menu_setlang(unsigned char lang)
|
|
lcd_update_enable(true);
|
|
lcd_update_enable(true);
|
|
lcd_implementation_clear();
|
|
lcd_implementation_clear();
|
|
lcd_goto_menu(lcd_language_menu);
|
|
lcd_goto_menu(lcd_language_menu);
|
|
- lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
|
|
|
+ lcd_timeoutToStatus = -1; //infinite timeout
|
|
lcdDrawUpdate = 2;
|
|
lcdDrawUpdate = 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4131,7 +4131,7 @@ void lcd_language()
|
|
lcd_update_enable(true);
|
|
lcd_update_enable(true);
|
|
lcd_implementation_clear();
|
|
lcd_implementation_clear();
|
|
lcd_goto_menu(lcd_language_menu);
|
|
lcd_goto_menu(lcd_language_menu);
|
|
- lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
|
|
|
+ lcd_timeoutToStatus = -1; //infinite timeout
|
|
lcdDrawUpdate = 2;
|
|
lcdDrawUpdate = 2;
|
|
while ((currentMenu != lcd_status_screen) && (!lang_is_selected()))
|
|
while ((currentMenu != lcd_status_screen) && (!lang_is_selected()))
|
|
{
|
|
{
|
|
@@ -4527,7 +4527,7 @@ static void lcd_homing_accuracy_menu_advanced_back()
|
|
|
|
|
|
static void lcd_homing_accuracy_menu_advanced()
|
|
static void lcd_homing_accuracy_menu_advanced()
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
MENU_BEGIN();
|
|
MENU_BEGIN();
|
|
///! MENU_ITEM_BACK_P(PSTR("Homing accuracy"), lcd_homing_accuracy_menu_advanced_back);
|
|
///! MENU_ITEM_BACK_P(PSTR("Homing accuracy"), lcd_homing_accuracy_menu_advanced_back);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset def. steps"), lcd_homing_accuracy_menu_advanced_reset);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset def. steps"), lcd_homing_accuracy_menu_advanced_reset);
|
|
@@ -4608,7 +4608,7 @@ static void lcd_ustep_resolution_reset_def_xyze()
|
|
|
|
|
|
static void lcd_ustep_resolution_menu()
|
|
static void lcd_ustep_resolution_menu()
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
MENU_BEGIN();
|
|
MENU_BEGIN();
|
|
///! MENU_ITEM_BACK_P(PSTR("Experimental"), lcd_ustep_resolution_menu_back);
|
|
///! MENU_ITEM_BACK_P(PSTR("Experimental"), lcd_ustep_resolution_menu_back);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset defaults"), lcd_ustep_resolution_reset_def_xyze);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset defaults"), lcd_ustep_resolution_reset_def_xyze);
|
|
@@ -4656,7 +4656,7 @@ static void lcd_ustep_linearity_menu_reset()
|
|
|
|
|
|
static void lcd_ustep_linearity_menu()
|
|
static void lcd_ustep_linearity_menu()
|
|
{
|
|
{
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
MENU_BEGIN();
|
|
MENU_BEGIN();
|
|
///! MENU_ITEM_BACK_P(PSTR("Experimental"), lcd_ustep_linearity_menu_back);
|
|
///! MENU_ITEM_BACK_P(PSTR("Experimental"), lcd_ustep_linearity_menu_back);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset correction"), lcd_ustep_linearity_menu_reset);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Reset correction"), lcd_ustep_linearity_menu_reset);
|
|
@@ -7466,7 +7466,7 @@ void lcd_init()
|
|
//#include <avr/pgmspace.h>
|
|
//#include <avr/pgmspace.h>
|
|
|
|
|
|
static volatile bool lcd_update_enabled = true;
|
|
static volatile bool lcd_update_enabled = true;
|
|
-LongTimer lcd_timeoutToStatus;
|
|
|
|
|
|
+unsigned long lcd_timeoutToStatus = 0;
|
|
|
|
|
|
void lcd_update_enable(bool enabled)
|
|
void lcd_update_enable(bool enabled)
|
|
{
|
|
{
|
|
@@ -7478,7 +7478,7 @@ void lcd_update_enable(bool enabled)
|
|
encoderDiff = 0;
|
|
encoderDiff = 0;
|
|
// Enabling the normal LCD update procedure.
|
|
// Enabling the normal LCD update procedure.
|
|
// Reset the timeout interval.
|
|
// Reset the timeout interval.
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
// Force the keypad update now.
|
|
// Force the keypad update now.
|
|
lcd_next_update_millis = millis() - 1;
|
|
lcd_next_update_millis = millis() - 1;
|
|
// Full update.
|
|
// Full update.
|
|
@@ -7497,24 +7497,6 @@ void lcd_update_enable(bool enabled)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-static inline bool z_menu_expired()
|
|
|
|
-{
|
|
|
|
- return (currentMenu == lcd_babystep_z
|
|
|
|
- && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z));
|
|
|
|
-}
|
|
|
|
-static inline bool other_menu_expired()
|
|
|
|
-{
|
|
|
|
- return (currentMenu != lcd_status_screen
|
|
|
|
- && currentMenu != lcd_babystep_z
|
|
|
|
- && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS));
|
|
|
|
-}
|
|
|
|
-static inline bool forced_menu_expire()
|
|
|
|
-{
|
|
|
|
- bool retval = (currentMenu != lcd_status_screen
|
|
|
|
- && forceMenuExpire);
|
|
|
|
- forceMenuExpire = false;
|
|
|
|
- return retval;
|
|
|
|
-}
|
|
|
|
|
|
|
|
void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|
void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|
{
|
|
{
|
|
@@ -7595,10 +7577,10 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|
lcdDrawUpdate = 1;
|
|
lcdDrawUpdate = 1;
|
|
encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
|
|
encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
|
|
encoderDiff = 0;
|
|
encoderDiff = 0;
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
}
|
|
}
|
|
|
|
|
|
- if (LCD_CLICKED) lcd_timeoutToStatus.start();
|
|
|
|
|
|
+ if (LCD_CLICKED) lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
#endif//ULTIPANEL
|
|
#endif//ULTIPANEL
|
|
|
|
|
|
(*currentMenu)();
|
|
(*currentMenu)();
|
|
@@ -7608,7 +7590,7 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef ULTIPANEL
|
|
#ifdef ULTIPANEL
|
|
- if (z_menu_expired() || other_menu_expired() || forced_menu_expire())
|
|
|
|
|
|
+ if (lcd_timeoutToStatus < millis() && currentMenu != lcd_status_screen)
|
|
{
|
|
{
|
|
// Exiting a menu. Let's call the menu function the last time with menuExiting flag set to true
|
|
// Exiting a menu. Let's call the menu function the last time with menuExiting flag set to true
|
|
// to give it a chance to save its state.
|
|
// to give it a chance to save its state.
|
|
@@ -7778,9 +7760,9 @@ void lcd_buttons_update()
|
|
#if BTN_ENC > 0
|
|
#if BTN_ENC > 0
|
|
if (lcd_update_enabled == true) { //if we are in non-modal mode, long press can be used and short press triggers with button release
|
|
if (lcd_update_enabled == true) { //if we are in non-modal mode, long press can be used and short press triggers with button release
|
|
if (READ(BTN_ENC) == 0) { //button is pressed
|
|
if (READ(BTN_ENC) == 0) { //button is pressed
|
|
- lcd_timeoutToStatus.start();
|
|
|
|
- if (!buttonBlanking.running() || buttonBlanking.expired(BUTTON_BLANKING_TIME)) {
|
|
|
|
- buttonBlanking.start();
|
|
|
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
|
+ if (millis() > button_blanking_time) {
|
|
|
|
+ button_blanking_time = millis() + BUTTON_BLANKING_TIME;
|
|
if (button_pressed == false && long_press_active == false) {
|
|
if (button_pressed == false && long_press_active == false) {
|
|
longPressTimer.start();
|
|
longPressTimer.start();
|
|
button_pressed = true;
|
|
button_pressed = true;
|
|
@@ -7796,7 +7778,7 @@ void lcd_buttons_update()
|
|
}
|
|
}
|
|
else { //button not pressed
|
|
else { //button not pressed
|
|
if (button_pressed) { //button was released
|
|
if (button_pressed) { //button was released
|
|
- buttonBlanking.start();
|
|
|
|
|
|
+ button_blanking_time = millis() + BUTTON_BLANKING_TIME;
|
|
|
|
|
|
if (long_press_active == false) { //button released before long press gets activated
|
|
if (long_press_active == false) { //button released before long press gets activated
|
|
newbutton |= EN_C;
|
|
newbutton |= EN_C;
|