From ec9f3fa6eace6cbae819dd7456bfda96a17893b8 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:42:51 +0200 Subject: [PATCH] T-Lora Pager: fix keyboard and improve rotary wheel haptic (#7869) * update RotaryEncoder: use interrupts * increase rotary encoder processing interval * remove disabling peripherals during LS --- src/input/RotaryEncoderImpl.cpp | 2 +- src/sleep.cpp | 17 ----------------- variants/esp32s3/tlora-pager/platformio.ini | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/input/RotaryEncoderImpl.cpp b/src/input/RotaryEncoderImpl.cpp index d3fcbbf9d..e00c1cc6f 100644 --- a/src/input/RotaryEncoderImpl.cpp +++ b/src/input/RotaryEncoderImpl.cpp @@ -70,7 +70,7 @@ int32_t RotaryEncoderImpl::runOnce() this->notifyObservers(&e); } - return 20; + return 10; } #endif \ No newline at end of file diff --git a/src/sleep.cpp b/src/sleep.cpp index bff318900..83597e349 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -431,15 +431,6 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq #endif -#ifdef T_LORA_PAGER - LOG_DEBUG("power down XL9555 io"); - io.digitalWrite(EXPANDS_DRV_EN, LOW); - io.digitalWrite(EXPANDS_AMP_EN, LOW); - io.digitalWrite(EXPANDS_KB_EN, LOW); - io.digitalWrite(EXPANDS_SD_EN, LOW); - io.digitalWrite(EXPANDS_GPIO_EN, LOW); -#endif - auto res = esp_sleep_enable_gpio_wakeup(); if (res != ESP_OK) { LOG_ERROR("esp_sleep_enable_gpio_wakeup result %d", res); @@ -480,14 +471,6 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r gpio_wakeup_disable((gpio_num_t)RF95_IRQ); } #endif -#ifdef T_LORA_PAGER - LOG_DEBUG("power up XL9555 io"); - io.digitalWrite(EXPANDS_DRV_EN, HIGH); - io.digitalWrite(EXPANDS_AMP_EN, HIGH); - io.digitalWrite(EXPANDS_KB_EN, HIGH); - io.digitalWrite(EXPANDS_SD_EN, HIGH); - io.digitalWrite(EXPANDS_GPIO_EN, HIGH); -#endif esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index b16e516a7..312d46259 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -26,7 +26,7 @@ lib_deps = ${esp32s3_base.lib_deps} lewisxhe/SensorLib@0.3.1 https://github.com/pschatzmann/arduino-audio-driver/archive/refs/tags/v0.1.3.zip https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip - https://github.com/mverch67/RotaryEncoder + https://github.com/mverch67/RotaryEncoder/archive/25a59d5745a6645536f921427d80b08e78f886d4.zip [env:tlora-pager-tft] board_level = extra