diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index b35c829d..5a3ed474 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1694,7 +1694,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no _sensors = sensors; _auto_off = millis() + AUTO_OFF_MILLIS; -#if defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON) +#if (defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON)) && !defined(MECK_DIAG_NO_PMU) user_btn.begin(); #endif #if defined(PIN_USER_BTN_ANA) @@ -2291,7 +2291,7 @@ void UITask::shutdown(bool restart){ } bool UITask::isButtonPressed() const { -#if defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON) +#if (defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON)) && !defined(MECK_DIAG_NO_PMU) return user_btn.isPressed(); #else return false; @@ -2314,7 +2314,7 @@ void UITask::loop() { } } #endif -#if defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON) +#if (defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON)) && !defined(MECK_DIAG_NO_PMU) int ev = user_btn.check(); if (ev == BUTTON_EVENT_CLICK) { #if defined(LilyGo_T5S3_EPaper_Pro) diff --git a/variants/lilygo_twatch_s3/WatchChannelConfigScreen.h b/examples/companion_radio/ui-new/WatchChannelConfigScreen.h similarity index 100% rename from variants/lilygo_twatch_s3/WatchChannelConfigScreen.h rename to examples/companion_radio/ui-new/WatchChannelConfigScreen.h diff --git a/variants/lilygo_twatch_s3/TWatchS3Board.cpp b/variants/lilygo_twatch_s3/TWatchS3Board.cpp index 3e947bee..82b0647d 100644 --- a/variants/lilygo_twatch_s3/TWatchS3Board.cpp +++ b/variants/lilygo_twatch_s3/TWatchS3Board.cpp @@ -177,11 +177,17 @@ bool TWatchS3Board::power_init() { PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); PMU->clearIrqStatus(); +#if !defined(MECK_DIAG_NO_PMU) // SHORT gives the click; NEGATIVE/POSITIVE are the press/release edges that // back PMUButton::isPressed(). PMU->enableIRQ(XPOWERS_AXP2101_PKEY_SHORT_IRQ | XPOWERS_AXP2101_PKEY_NEGATIVE_IRQ | XPOWERS_AXP2101_PKEY_POSITIVE_IRQ); +#endif + // TEMP DIAGNOSTIC (MECK_DIAG_NO_PMU, power bisect): with the PKEY IRQs left + // disabled above and PMUButton::check() skipped in UITask, the PMU-button + // subsystem is fully inert -- no IRQ config, no 30 ms polling, no dangling + // latch. disableIRQ(ALL)+clearIrqStatus above already left the PMU quiet. // 150 mA = 0.32C on the 470 mAh cell -- a modest bump over the 125 mA // vendor default (LilyGoWatchS3.cpp uses 125), well under the 0.5C rule. diff --git a/variants/lilygo_twatch_s3/platformio.ini b/variants/lilygo_twatch_s3/platformio.ini index 32d588c0..28bd989e 100644 --- a/variants/lilygo_twatch_s3/platformio.ini +++ b/variants/lilygo_twatch_s3/platformio.ini @@ -137,4 +137,42 @@ lib_deps = densaugeo/base64 @ ~1.4.0 lib_ignore = AsyncTCP - ESPAsyncWebServer \ No newline at end of file + ESPAsyncWebServer +; --------------------------------------------------------------------------- +; TEMP DIAGNOSTIC BUILD -- power-drain bisect (remove when concluded). +; The S3 standalone firmware with the PMU-button subsystem fully disabled, +; gated by MECK_DIAG_NO_PMU: the PKEY IRQ enable in power_init is skipped and +; PMUButton::check()/begin()/isPressed() are compiled out of UITask, so there +; is no IRQ config and no 30 ms I2C polling of the PMU (and no dangling latch). +; Run the same wear test as the standalone S3 build; a materially slower drain +; implicates the PMU-button subsystem in the S3-only excess. The PWR key does +; nothing on this build (no click, no wake, no path-editor open) by design. +; Revert: delete this env and grep MECK_DIAG_NO_PMU (one block in +; TWatchS3Board.cpp, three in UITask.cpp). +; Flash: pio run -e meck_twatch_s3_diag_nopmu -t upload +; --------------------------------------------------------------------------- +[env:meck_twatch_s3_diag_nopmu] +extends = LilyGo_TWatchS3 +build_flags = + ${LilyGo_TWatchS3.build_flags} + -I examples/companion_radio/ui-new + -D MAX_CONTACTS=2000 + -D MAX_GROUP_CHANNELS=40 + -D OFFLINE_QUEUE_SIZE=1 + -D ESP32_CPU_FREQ=80 + -D MECK_DIAG_NO_PMU + -D FIRMWARE_VERSION='"Meck TWatch S3 DiagNoPMU v0.1"' +build_src_filter = ${LilyGo_TWatchS3.build_src_filter} + + + - + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> + + +lib_deps = + ${LilyGo_TWatchS3.lib_deps} + densaugeo/base64 @ ~1.4.0 +lib_ignore = + AsyncTCP + ESPAsyncWebServer + ESP32 BLE Arduino \ No newline at end of file