|
@@ -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;
|
|
@@ -1289,6 +1291,11 @@ void lcd_update()
|
1289
|
1291
|
}
|
1290
|
1292
|
}
|
1291
|
1293
|
|
|
1294
|
+void lcd_ignore_click(bool b)
|
|
1295
|
+{
|
|
1296
|
+ ignore_click = b;
|
|
1297
|
+}
|
|
1298
|
+
|
1292
|
1299
|
void lcd_setstatus(const char* message)
|
1293
|
1300
|
{
|
1294
|
1301
|
if (lcd_status_message_level > 0)
|
|
@@ -1418,7 +1425,26 @@ void lcd_buzz(long duration, uint16_t freq)
|
1418
|
1425
|
|
1419
|
1426
|
bool lcd_clicked()
|
1420
|
1427
|
{
|
1421
|
|
- return LCD_CLICKED;
|
|
1428
|
+ static bool wait_for_unclick = false;
|
|
1429
|
+ bool current_click = LCD_CLICKED;
|
|
1430
|
+
|
|
1431
|
+ if (ignore_click) {
|
|
1432
|
+ if (wait_for_unclick) {
|
|
1433
|
+ if (!current_click) {
|
|
1434
|
+ ignore_click = wait_for_unclick = false;
|
|
1435
|
+ }
|
|
1436
|
+ else {
|
|
1437
|
+ current_click = false;
|
|
1438
|
+ }
|
|
1439
|
+ }
|
|
1440
|
+ else if (current_click) {
|
|
1441
|
+ wait_for_unclick = true;
|
|
1442
|
+ current_click = false;
|
|
1443
|
+ lcd_quick_feedback();
|
|
1444
|
+ }
|
|
1445
|
+ }
|
|
1446
|
+
|
|
1447
|
+ return current_click;
|
1422
|
1448
|
}
|
1423
|
1449
|
#endif//ULTIPANEL
|
1424
|
1450
|
|