Browse Source

Bind button actions to buttons 0 and 1 in DUAL (#127)

fastled
Xose Pérez 7 years ago
parent
commit
134647724a
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      code/espurna/button.ino

+ 3
- 3
code/espurna/button.ino View File

@ -108,8 +108,8 @@ void buttonSetup() {
#ifdef SONOFF_DUAL #ifdef SONOFF_DUAL
unsigned int actions = buttonStore(BUTTON_MODE_NONE, BUTTON_MODE_TOGGLE, BUTTON_MODE_NONE, BUTTON_MODE_NONE, BUTTON_MODE_NONE); unsigned int actions = buttonStore(BUTTON_MODE_NONE, BUTTON_MODE_TOGGLE, BUTTON_MODE_NONE, BUTTON_MODE_NONE, BUTTON_MODE_NONE);
_buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), 0, 1});
_buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), 0, 2});
_buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, 1});
_buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, 2});
_buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, BUTTON3_RELAY}); _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, BUTTON3_RELAY});
#else #else
@ -176,7 +176,7 @@ void buttonLoop() {
bool status = (value & (1 << i)) > 0; bool status = (value & (1 << i)) > 0;
// Cjeck if the status for that relay has changed
// Check if the status for that relay has changed
if (relayStatus(i) != status) { if (relayStatus(i) != status) {
buttonEvent(i, BUTTON_EVENT_CLICK); buttonEvent(i, BUTTON_EVENT_CLICK);
break; break;


Loading…
Cancel
Save