Swapped short/long press for option: short is now the menu, long turns the display off

Swapped Reset and Cancel in menu: Cancel is now the default
This commit is contained in:
Mark van Renswoude 2017-08-05 23:08:26 +02:00
parent b6974d9e80
commit b7d7bf405f
2 changed files with 9 additions and 9 deletions

View File

@ -24,16 +24,16 @@ void handleCounterScreen()
{
if (button_is_pressed_short(&buttonOption))
{
// Turn off power to the screen
if (powerState == On)
setPowerState(ManualOff);
setCurrentScreen(Menu);
return;
}
if (button_is_pressed_long(&buttonOption))
{
setCurrentScreen(Menu);
// Turn off power to the screen
if (powerState == On)
setPowerState(ManualOff);
return;
}

View File

@ -9,9 +9,9 @@
#include "counter.h"
#define MenuItemReset 0
#define MenuItemCancel 1
#define MenuCount MenuItemCancel + 1
#define MenuItemCancel 0
#define MenuItemReset 1
#define MenuCount MenuItemReset + 1
uint8_t currentIndex = 0;
@ -68,8 +68,8 @@ void drawMenu()
{
// Since there are only two items at the moment, they're always going to be
// involved in the change, so simply repaint them.
drawMenuItem(MenuItemReset, "Reset ");
drawMenuItem(MenuItemCancel, "Cancel ");
drawMenuItem(MenuItemReset, "Reset ");
// Can't use sprintf because that'll use up more than the