We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97a17b2 commit bb47d5eCopy full SHA for bb47d5e
src/Encoder.cpp
@@ -219,7 +219,7 @@ void Encoder::init(void (*doA)(), void(*doB)()){
219
}
220
221
// if index used intialise the index interrupt
222
- if(hasIndex() || doA != nullptr) {
+ if(hasIndex() && doA != nullptr) {
223
*digitalPinToPCMSK(index_pin) |= bit (digitalPinToPCMSKbit(index_pin)); // enable pin
224
PCIFR |= bit (digitalPinToPCICRbit(index_pin)); // clear any outstanding interrupt
225
PCICR |= bit (digitalPinToPCICRbit(index_pin)); // enable interrupt for the group
0 commit comments