mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 11:01:15 +00:00
Rename axp192_found to pmu_found to avoid confusion
This commit is contained in:
parent
a50a461675
commit
9244d03cf9
@ -129,7 +129,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
// If user button is held down for 5 seconds, shutdown the device.
|
// If user button is held down for 5 seconds, shutdown the device.
|
||||||
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (axp192_found == true) {
|
if (pmu_found == true) {
|
||||||
setLed(false);
|
setLed(false);
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
|
@ -564,9 +564,9 @@ bool Power::axpChipInit()
|
|||||||
|
|
||||||
readPowerStatus();
|
readPowerStatus();
|
||||||
|
|
||||||
axp192_found = true;
|
pmu_found = true;
|
||||||
|
|
||||||
return axp192_found;
|
return pmu_found;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
@ -117,7 +117,7 @@ void scanI2Cdevice(void)
|
|||||||
}
|
}
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (addr == XPOWERS_AXP192_AXP2101_ADDRESS) {
|
if (addr == XPOWERS_AXP192_AXP2101_ADDRESS) {
|
||||||
axp192_found = true;
|
pmu_found = true;
|
||||||
DEBUG_MSG("axp192/axp2101 PMU found\n");
|
DEBUG_MSG("axp192/axp2101 PMU found\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,7 +84,7 @@ bool eink_found = true;
|
|||||||
|
|
||||||
uint32_t serialSinceMsec;
|
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
|
// 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 };
|
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)
|
// Do this after service.init (because that clears error_code)
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (!axp192_found)
|
if (!pmu_found)
|
||||||
RECORD_CRITICALERROR(CriticalErrorCode_NoAXP192); // Record a hardware fault for missing hardware
|
RECORD_CRITICALERROR(CriticalErrorCode_NoAXP192); // Record a hardware fault for missing hardware
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ extern uint8_t faceskb_found;
|
|||||||
extern uint8_t rtc_found;
|
extern uint8_t rtc_found;
|
||||||
|
|
||||||
extern bool eink_found;
|
extern bool eink_found;
|
||||||
extern bool axp192_found;
|
extern bool pmu_found;
|
||||||
extern bool isCharging;
|
extern bool isCharging;
|
||||||
extern bool isUSBPowered;
|
extern bool isUSBPowered;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ void powerCommandsCheck()
|
|||||||
if (shutdownAtMsec && millis() > shutdownAtMsec) {
|
if (shutdownAtMsec && millis() > shutdownAtMsec) {
|
||||||
DEBUG_MSG("Shutting down from admin command\n");
|
DEBUG_MSG("Shutting down from admin command\n");
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (axp192_found == true) {
|
if (pmu_found == true) {
|
||||||
playShutdownMelody();
|
playShutdownMelody();
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ void setLed(bool ledOn)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (axp192_found) {
|
if (pmu_found) {
|
||||||
// blink the axp led
|
// blink the axp led
|
||||||
PMU->setChargingLedMode(ledOn ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
|
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);
|
DEBUG_MSG("Setting GPS power=%d\n", on);
|
||||||
|
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (axp192_found){
|
if (pmu_found){
|
||||||
#ifdef LILYGO_TBEAM_S3_CORE
|
#ifdef LILYGO_TBEAM_S3_CORE
|
||||||
on ? PMU->enablePowerOutput(XPOWERS_ALDO4) : PMU->disablePowerOutput(XPOWERS_ALDO4);
|
on ? PMU->enablePowerOutput(XPOWERS_ALDO4) : PMU->disablePowerOutput(XPOWERS_ALDO4);
|
||||||
#else
|
#else
|
||||||
@ -191,7 +191,7 @@ void doDeepSleep(uint64_t msecToWake)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#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.
|
// 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
|
// 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
|
// 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
|
#endif
|
||||||
#ifdef PMU_IRQ
|
#ifdef PMU_IRQ
|
||||||
// wake due to PMU can happen repeatedly if there is no battery installed or the battery fills
|
// 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
|
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
|
||||||
#endif
|
#endif
|
||||||
assert(esp_sleep_enable_gpio_wakeup() == ESP_OK);
|
assert(esp_sleep_enable_gpio_wakeup() == ESP_OK);
|
||||||
|
Loading…
Reference in New Issue
Block a user