Skip to content

Commit eca871f

Browse files
committed
#153 allow encoders on any pin with polling mode. Minor fix
1 parent 250346f commit eca871f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SwitchInput.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ void SwitchInput::init(IoAbstractionRef device, SwitchInterruptMode mode, bool d
151151
});
152152
} else if(mode == SWITCHES_POLL_EVERYTHING) {
153153
serdebugF("Switches polling for everything");
154-
taskManager.scheduleFixedRate(SWITCH_POLL_INTERVAL / 2, [] {
155-
switches.runLoop();
154+
taskManager.scheduleFixedRate(SWITCH_POLL_INTERVAL / 4, [] {
155+
static uint8_t counter = 0;
156+
if(++counter % 4 == 3) {
157+
switches.runLoop();
158+
}
156159
onSwitchesInterrupt(-1);
157160
});
158161
}

0 commit comments

Comments
 (0)