diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 8d4e151c..b35c829d 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -2314,11 +2314,6 @@ void UITask::loop() { } } #endif -#if defined(MECK_DIAG_PMU_BTN) - // TEMP DIAGNOSTIC (power bisect): drive the PMU-key poll replica every loop - // (it rate-limits itself to 30 ms, matching PMUButton). Remove with the env. - board.diagPollPmuKey(); -#endif #if defined(PIN_USER_BTN) || defined(MECK_PMU_BUTTON) int ev = user_btn.check(); if (ev == BUTTON_EVENT_CLICK) { diff --git a/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.cpp b/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.cpp index ac7f7e85..b4c0fe45 100644 --- a/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.cpp +++ b/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.cpp @@ -153,8 +153,11 @@ bool TWatchS3PlusBoard::power_init() { PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); PMU->clearIrqStatus(); - PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_125MA); - PMU->setChargeTargetVoltage(XPOWERS_AXP2101_CHG_VOL_4V2); + PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_200MA); + // The fitted cell (Tewaycell 112530-2P, label verified) is 3.8V nominal + // LiHV -- i.e. 4.35V max charge, same chemistry as the S3's cell. Charging + // to 4V2 forfeits the top ~12-15% of capacity. + PMU->setChargeTargetVoltage(XPOWERS_AXP2101_CHG_VOL_4V35); PMU->disableTSPinMeasure(); PMU->enableSystemVoltageMeasure(); @@ -162,17 +165,6 @@ bool TWatchS3PlusBoard::power_init() { PMU->enableBattVoltageMeasure(); PMU->setPowerKeyPressOffTime(XPOWERS_POWEROFF_4S); -#if defined(MECK_DIAG_PMU_BTN) - // TEMP DIAGNOSTIC (power bisect): replicate the S3 build's PWR-key config - // exactly -- press-on time, IRQ level time, and the PKEY IRQ trio -- so the - // PMU is in the same state as under PMUButton. disableIRQ(ALL) and - // clearIrqStatus have already run above, matching the S3's ordering. - PMU->setPowerKeyPressOnTime(XPOWERS_POWERON_2S); - ((XPowersAXP2101*)PMU)->setIrqLevelTime(XPOWERS_AXP2101_IRQ_TIME_1S); - PMU->enableIRQ(XPOWERS_AXP2101_PKEY_SHORT_IRQ | - XPOWERS_AXP2101_PKEY_NEGATIVE_IRQ | - XPOWERS_AXP2101_PKEY_POSITIVE_IRQ); -#endif // TEMP power-debug: one-shot rail dump at boot. Rail OFF means the attached // chip has no power at all (not merely sleeping). @@ -222,23 +214,4 @@ uint32_t TWatchS3PlusBoard::getStepCount() { if (!bma423ReadRegs(BMA423_REG_STEP_CNT_OUT, d, 4)) return 0; return (uint32_t)d[0] | ((uint32_t)d[1] << 8) | ((uint32_t)d[2] << 16) | ((uint32_t)d[3] << 24); -} - -#if defined(MECK_DIAG_PMU_BTN) -// TEMP DIAGNOSTIC (power bisect): reproduce PMUButton::check()'s I2C traffic -// -- same registers, same 30 ms cadence -- with the events discarded. If this -// build drains like the S3 firmware on the same watch, the PMU-button -// machinery is the culprit; if not, the excess lies elsewhere in the S3 set. -void TWatchS3PlusBoard::diagPollPmuKey() { - static unsigned long last_poll = 0; - if (millis() - last_poll < 30) return; - last_poll = millis(); - if (PMU == NULL) return; - XPowersAXP2101* axp = (XPowersAXP2101*)PMU; - axp->getIrqStatus(); // latch INTSTS1..3 into the driver's buffer - (void)axp->isPekeyNegativeIrq(); - (void)axp->isPekeyPositiveIrq(); - (void)axp->isPekeyShortPressIrq(); - axp->clearIrqStatus(); -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.h b/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.h index 25cb66dc..50fa738c 100644 --- a/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.h +++ b/variants/lilygo_twatch_s3_plus/TWatchS3PlusBoard.h @@ -67,12 +67,6 @@ public: // TEMP power-debug probe: battery, VBUS, CPU clock, BT controller state and // live rail states (incl. GPS/BLDO1). Called periodically from UITask::loop. void printPowerDebug(); -#if defined(MECK_DIAG_PMU_BTN) - // TEMP DIAGNOSTIC (power bisect): reproduce the S3 PMUButton's 30 ms PMU - // register polling on this build. Called from UITask::loop; remove together - // with the meck_twatch_s3_plus_diag_pmubtn env. - void diagPollPmuKey(); -#endif const char* getManufacturerName() const override { return "LilyGo T-Watch S3 Plus"; diff --git a/variants/lilygo_twatch_s3_plus/platformio.ini b/variants/lilygo_twatch_s3_plus/platformio.ini index 3c3b0380..ff5514a5 100644 --- a/variants/lilygo_twatch_s3_plus/platformio.ini +++ b/variants/lilygo_twatch_s3_plus/platformio.ini @@ -153,39 +153,4 @@ lib_deps = densaugeo/base64 @ ~1.4.0 lib_ignore = AsyncTCP - ESPAsyncWebServer -; --------------------------------------------------------------------------- -; TEMP DIAGNOSTIC BUILD -- power-drain bisect (remove when concluded). -; The Plus standalone firmware plus ONLY the S3's PMU-button machinery, -; gated by MECK_DIAG_PMU_BTN: the PKEY IRQ config in power_init and a 30 ms -; poll replicating PMUButton::check()'s I2C traffic (events discarded). -; Flash onto the plain S3 and compare drain against the standalone build. -; Revert: delete this env and grep MECK_DIAG_PMU_BTN (three guarded blocks: -; TWatchS3PlusBoard.h, TWatchS3PlusBoard.cpp x2, UITask.cpp). -; Flash: pio run -e meck_twatch_s3_plus_diag_pmubtn -t upload -; --------------------------------------------------------------------------- -[env:meck_twatch_s3_plus_diag_pmubtn] -extends = LilyGo_TWatchS3Plus -build_flags = - ${LilyGo_TWatchS3Plus.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_PMU_BTN - -D FIRMWARE_VERSION='"Meck TWatch DiagPMU v0.2"' -build_src_filter = ${LilyGo_TWatchS3Plus.build_src_filter} - + - - - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> - + -lib_deps = - ${LilyGo_TWatchS3Plus.lib_deps} - densaugeo/base64 @ ~1.4.0 -lib_ignore = - AsyncTCP - ESPAsyncWebServer - ESP32 BLE Arduino \ No newline at end of file + ESPAsyncWebServer \ No newline at end of file