Merge branch 'main' into TaskDrivenTrial

This commit is contained in:
2026-01-07 18:32:43 -06:00
committed by GitHub
6 changed files with 180 additions and 79 deletions

View File

@@ -10,7 +10,8 @@ static const char *TAG = "ENCODER";
// Constructor
Encoder::Encoder(gpio_num_t pinA, gpio_num_t pinB)
: pin_a(pinA), pin_b(pinB), count(0),
last_state_a(0), last_state_b(0), last_count_base(0) {}
last_state_a(0), last_state_b(0), last_count_base(0),
watchdog_handle(nullptr) {}
// Static ISR - receives Encoder instance via arg
void IRAM_ATTR Encoder::isr_handler(void* arg)
@@ -122,9 +123,9 @@ void Encoder::setupWatchdog() {
feedWDog = true;
}
void Encoder::pauseWatchdog() {
void IRAM_ATTR Encoder::pauseWatchdog() {
if (watchdog_handle != nullptr) esp_timer_stop(watchdog_handle);
feedWDog = false;
if (watchdog_handle != NULL) esp_timer_stop(watchdog_handle);
}
Encoder::~Encoder() {