@@ -1575,25 +1575,29 @@ void buttonCheckTask(void *e)
1575
1575
if ((previousButtonRelease > 0 ) && (thisButtonRelease > 0 ) &&
1576
1576
((thisButtonRelease - previousButtonRelease) <= doubleTapInterval)) // Do we have a double tap?
1577
1577
{
1578
- doubleTap = true ;
1579
- singleTap = false ;
1580
- previousButtonRelease = 0 ;
1581
- thisButtonRelease = 0 ;
1578
+ // Do not register button taps until the system is displaying the menu
1579
+ if (systemState == STATE_DISPLAY_SETUP)
1580
+ {
1581
+ doubleTap = true ;
1582
+ singleTap = false ;
1583
+ previousButtonRelease = 0 ;
1584
+ thisButtonRelease = 0 ;
1585
+ }
1582
1586
}
1583
1587
else if ((thisButtonRelease > 0 ) &&
1584
1588
((millis () - thisButtonRelease) > doubleTapInterval)) // Do we have a single tap?
1585
1589
{
1586
- // Discard the first button press as it was used to display the menu
1587
- if (showMenu == true )
1588
- {
1589
- showMenu = false ;
1590
- }
1591
- else
1590
+ // Do not register button taps until the system is displaying the menu
1591
+ if (systemState == STATE_DISPLAY_SETUP)
1592
1592
{
1593
- doubleTap = false ;
1594
- singleTap = true ;
1595
1593
previousButtonRelease = 0 ;
1596
1594
thisButtonRelease = 0 ;
1595
+ doubleTap = false ;
1596
+
1597
+ if (firstButtonThrownOut == false )
1598
+ firstButtonThrownOut = true ; // Throw away the first button press
1599
+ else
1600
+ singleTap = true ;
1597
1601
}
1598
1602
}
1599
1603
@@ -1750,8 +1754,8 @@ void buttonCheckTask(void *e)
1750
1754
lastSystemState = systemState; // Remember this state to return if needed
1751
1755
requestChangeState (STATE_DISPLAY_SETUP);
1752
1756
lastSetupMenuChange = millis ();
1753
- setupSelectedButton = 0 ; // Highlight the first button
1754
- forceDisplayUpdate = true ; // User is interacting so repaint display quickly
1757
+ setupSelectedButton = 0 ; // Highlight the first button
1758
+ showMenu = false ;
1755
1759
break ;
1756
1760
1757
1761
case STATE_DISPLAY_SETUP:
@@ -1838,7 +1842,10 @@ void buttonCheckTask(void *e)
1838
1842
requestChangeState (STATE_PROFILE);
1839
1843
}
1840
1844
else if (it->newState == STATE_NOT_SET) // Exit
1845
+ {
1846
+ firstButtonThrownOut = false ;
1841
1847
requestChangeState (lastSystemState);
1848
+ }
1842
1849
else
1843
1850
requestChangeState (it->newState );
1844
1851
0 commit comments