Fixed probleb with copy assignment of settings in LEDRunner and DisplayHelper classes. Cleaned code up a bit.

This commit is contained in:
Author glitchrain
2024-12-15 03:30:30 -08:00
committed by s.aydarov
parent 031a19b107
commit 11b4909f39
8 changed files with 246 additions and 294 deletions

View File

@@ -42,11 +42,29 @@ public:
return m_DownButton;
}
int GetUpDownButtonsShortClicked()
{
bool upButtonShortClicked = m_UpButton.IsNowShortClicked();
bool downButtonShortClicked = m_DownButton.IsNowShortClicked();
if(upButtonShortClicked)
return BTN_UP_SHORT_CLICKED;
else if(downButtonShortClicked)
return BTN_DOWN_SHORT_CLICKED;
return BTN_DOWN_UP_NO_SHORT_CLICKED;
}
int GetUpDownButtonsHold()
{
bool upButtonHold = m_UpButton.IsHolded();
bool downButtonHold = m_DownButton.IsHolded();
return (upButtonHold - downButtonHold);
}
private:
bool m_InputEvent;
SimpleButton m_MainButton = SimpleButton(PIN_BTN_MAIN, LONG_CLICK_TIME_MS);
SimpleButton m_UpButton = SimpleButton(PIN_BTN_UP, LONG_CLICK_TIME_MS);
SimpleButton m_UpButton = SimpleButton(PIN_BTN_UP, LONG_CLICK_TIME_MS);
SimpleButton m_DownButton = SimpleButton(PIN_BTN_DOWN, LONG_CLICK_TIME_MS);
};