Defined up downbuttons' hold constants.
This commit is contained in:
committed by
s.aydarov
parent
11b4909f39
commit
2bbfeb8940
@@ -25,4 +25,8 @@
|
||||
#define BTN_DOWN_SHORT_CLICKED -1
|
||||
#define BTN_DOWN_UP_NO_SHORT_CLICKED 0
|
||||
|
||||
#define BTN_UP_HOLDED 1
|
||||
#define BTN_DOWN_HOLDED -1
|
||||
#define BTN_DOWN_UP_NOT_HOLDED 0
|
||||
|
||||
#endif
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
Settings::getInstance().setSwitchTime(Settings::getInstance().SwitchTime + upDownButtons * 50);
|
||||
UpdateModeDisplay();
|
||||
}
|
||||
if(upDownButtonsHold != 0)
|
||||
if(upDownButtonsHold != BTN_DOWN_UP_NOT_HOLDED)
|
||||
{
|
||||
m_DisplayHelper.setDrawTitle(false);
|
||||
Settings::getInstance().setSwitchTime(Settings::getInstance().SwitchTime + upDownButtonsHold * 50);
|
||||
@@ -139,7 +139,7 @@ private:
|
||||
UpdateModeDisplay();
|
||||
}
|
||||
|
||||
if(upDownButtonsHold != 0)
|
||||
if(upDownButtonsHold != BTN_DOWN_UP_NOT_HOLDED)
|
||||
{
|
||||
m_LEDRunner.setAllHigh();
|
||||
m_DisplayHelper.setDrawTitle(false);
|
||||
|
||||
@@ -57,7 +57,11 @@ public:
|
||||
{
|
||||
bool upButtonHold = m_UpButton.IsHolded();
|
||||
bool downButtonHold = m_DownButton.IsHolded();
|
||||
return (upButtonHold - downButtonHold);
|
||||
if(upButtonHold)
|
||||
return BTN_UP_HOLDED;
|
||||
else if(downButtonHold)
|
||||
return BTN_DOWN_HOLDED;
|
||||
return BTN_DOWN_UP_NOT_HOLDED;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user