Skip to content

Commit c847f8e

Browse files
author
tablatronix
committed
encoder priority
1 parent 12be5f5 commit c847f8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

button_abs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ int encoderLast = -1; // prev value
2121
bool encoderHasChange = false; // flag enc change
2222
bool useInt = false; // use interrupts, via interruptPin
2323

24+
long int encoderLastChange = 0; // timestamp of last encoder change
25+
int encoderThrottleDuration = 500; // how long to defer loop for encoder waits
26+
2427
bool encoderHasPress = false;
2528
bool encoderHasHold = false;
2629
bool debug_enc = false;
@@ -31,6 +34,7 @@ void encoderClear(){
3134
encoderHasPress = false;
3235
encoderHasHold = false;
3336
encoderHasChange = false;
37+
encoderLastChange = millis();
3438
}
3539

3640
void IRAM_ATTR onEncoderChange(int newValue) {

0 commit comments

Comments
 (0)