This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://github.com/igorantolic/ai-esp32-rotary-encoder | |
// and fixed using http://blog.templaro.com/reading-a-rotary-encoder-demo-code-for-atmega328/ | |
#include "AiEsp32RotaryEncoder.h" | |
void IRAM_ATTR AiEsp32RotaryEncoder::readEncoder_ISR() { | |
portENTER_CRITICAL_ISR(&(this->mux)); | |
if (this->isEnabled) { | |
this->old_AB <<= 2; // remember previous state |