Rename axp192_found to pmu_found to avoid confusion

This commit is contained in:
lewishe 2022-09-08 10:32:12 +08:00
parent a50a461675
commit 9244d03cf9
7 changed files with 12 additions and 12 deletions

View File

@ -129,7 +129,7 @@ class ButtonThread : public concurrency::OSThread
// If user button is held down for 5 seconds, shutdown the device.
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (axp192_found == true) {
if (pmu_found == true) {
setLed(false);
power->shutdown();
}

View File

@ -564,9 +564,9 @@ bool Power::axpChipInit()
readPowerStatus();
axp192_found = true;
pmu_found = true;
return axp192_found;
return pmu_found;
#else
return false;

View File

@ -117,7 +117,7 @@ void scanI2Cdevice(void)
}
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (addr == XPOWERS_AXP192_AXP2101_ADDRESS) {
axp192_found = true;
pmu_found = true;
DEBUG_MSG("axp192/axp2101 PMU found\n");
}
#endif

View File

@ -84,7 +84,7 @@ bool eink_found = true;
uint32_t serialSinceMsec;
bool axp192_found;
bool pmu_found;
// Array map of sensor types (as array index) and i2c address as value we'll find in the i2c scan
uint8_t nodeTelemetrySensorsMap[7] = { 0, 0, 0, 0, 0, 0, 0 };
@ -302,7 +302,7 @@ void setup()
// Do this after service.init (because that clears error_code)
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (!axp192_found)
if (!pmu_found)
RECORD_CRITICALERROR(CriticalErrorCode_NoAXP192); // Record a hardware fault for missing hardware
#endif

View File

@ -15,7 +15,7 @@ extern uint8_t faceskb_found;
extern uint8_t rtc_found;
extern bool eink_found;
extern bool axp192_found;
extern bool pmu_found;
extern bool isCharging;
extern bool isUSBPowered;

View File

@ -36,7 +36,7 @@ void powerCommandsCheck()
if (shutdownAtMsec && millis() > shutdownAtMsec) {
DEBUG_MSG("Shutting down from admin command\n");
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (axp192_found == true) {
if (pmu_found == true) {
playShutdownMelody();
power->shutdown();
}

View File

@ -79,7 +79,7 @@ void setLed(bool ledOn)
#endif
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (axp192_found) {
if (pmu_found) {
// blink the axp led
PMU->setChargingLedMode(ledOn ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
}
@ -91,7 +91,7 @@ void setGPSPower(bool on)
DEBUG_MSG("Setting GPS power=%d\n", on);
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (axp192_found){
if (pmu_found){
#ifdef LILYGO_TBEAM_S3_CORE
on ? PMU->enablePowerOutput(XPOWERS_ALDO4) : PMU->disablePowerOutput(XPOWERS_ALDO4);
#else
@ -191,7 +191,7 @@ void doDeepSleep(uint64_t msecToWake)
#endif
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if (axp192_found) {
if (pmu_found) {
// Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep.
// We no longer do that, because our light-sleep current draws are low enough and it provides fast start/low cost
// wake. We currently use deep sleep only for 'we want our device to actually be off - because our battery is
@ -264,7 +264,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
#endif
#ifdef PMU_IRQ
// wake due to PMU can happen repeatedly if there is no battery installed or the battery fills
if (axp192_found)
if (pmu_found)
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
#endif
assert(esp_sleep_enable_gpio_wakeup() == ESP_OK);