|
@@ -162,6 +162,7 @@ bool lcd_oldcardstatus;
|
162
|
162
|
menuFunc_t currentMenu = lcd_status_screen; /* function pointer to the currently active menu */
|
163
|
163
|
uint32_t lcd_next_update_millis;
|
164
|
164
|
uint8_t lcd_status_update_delay;
|
|
165
|
+bool ignore_click = false;
|
165
|
166
|
uint8_t lcdDrawUpdate = 2; /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
|
166
|
167
|
|
167
|
168
|
//prevMenu and prevEncoderPosition are used to store the previous menu location when editing settings.
|
|
@@ -189,7 +190,8 @@ static void lcd_status_screen()
|
189
|
190
|
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 */
|
190
|
191
|
}
|
191
|
192
|
#ifdef ULTIPANEL
|
192
|
|
- if (LCD_CLICKED)
|
|
193
|
+
|
|
194
|
+ if (lcd_clicked())
|
193
|
195
|
{
|
194
|
196
|
currentMenu = lcd_main_menu;
|
195
|
197
|
encoderPosition = 0;
|
|
@@ -1315,6 +1317,11 @@ void lcd_update()
|
1315
|
1317
|
}
|
1316
|
1318
|
}
|
1317
|
1319
|
|
|
1320
|
+void lcd_ignore_click(bool b)
|
|
1321
|
+{
|
|
1322
|
+ ignore_click = b;
|
|
1323
|
+}
|
|
1324
|
+
|
1318
|
1325
|
void lcd_setstatus(const char* message)
|
1319
|
1326
|
{
|
1320
|
1327
|
if (lcd_status_message_level > 0)
|
|
@@ -1444,7 +1451,26 @@ void lcd_buzz(long duration, uint16_t freq)
|
1444
|
1451
|
|
1445
|
1452
|
bool lcd_clicked()
|
1446
|
1453
|
{
|
1447
|
|
- return LCD_CLICKED;
|
|
1454
|
+ static bool wait_for_unclick = false;
|
|
1455
|
+ bool current_click = LCD_CLICKED;
|
|
1456
|
+
|
|
1457
|
+ if (ignore_click) {
|
|
1458
|
+ if (wait_for_unclick) {
|
|
1459
|
+ if (!current_click) {
|
|
1460
|
+ ignore_click = wait_for_unclick = false;
|
|
1461
|
+ }
|
|
1462
|
+ else {
|
|
1463
|
+ current_click = false;
|
|
1464
|
+ }
|
|
1465
|
+ }
|
|
1466
|
+ else if (current_click) {
|
|
1467
|
+ wait_for_unclick = true;
|
|
1468
|
+ current_click = false;
|
|
1469
|
+ lcd_quick_feedback();
|
|
1470
|
+ }
|
|
1471
|
+ }
|
|
1472
|
+
|
|
1473
|
+ return current_click;
|
1448
|
1474
|
}
|
1449
|
1475
|
#endif//ULTIPANEL
|
1450
|
1476
|
|