Browse Source

Buttons: small optimization for vector

mcspr-patch-1
Maxim Prokhorov 4 years ago
parent
commit
712bd8a5e1
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      code/espurna/button.ino

+ 6
- 0
code/espurna/button.ino View File

@ -159,12 +159,16 @@ void buttonSetup() {
#if defined(ITEAD_SONOFF_DUAL)
_buttons.reserve(3);
buttonAdd(GPIO_NONE, BUTTON_PUSHBUTTON, 0, _buttonRelay(0));
buttonAdd(GPIO_NONE, BUTTON_PUSHBUTTON, 0, _buttonRelay(1));
buttonAdd(GPIO_NONE, BUTTON_PUSHBUTTON, 0, _buttonRelay(2));
#elif defined(FOXEL_LIGHTFOX_DUAL)
_buttons.reserve(4);
const auto actions = _buttonConstructActions(
BUTTON_MODE_NONE, BUTTON_MODE_TOGGLE, BUTTON_MODE_NONE,
BUTTON_MODE_NONE, BUTTON_MODE_NONE, BUTTON_MODE_NONE
@ -208,6 +212,8 @@ void buttonSetup() {
++buttons;
#endif
_buttons.reserve(buttons);
// TODO: load based on index
button_t::DebounceDelay = getSetting("btnDebounce", BUTTON_DEBOUNCE_DELAY);
button_t::DblclickDelay = getSetting("btnDelay", BUTTON_DBLCLICK_DELAY);


Loading…
Cancel
Save