mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-03 12:20:43 +00:00
Fixing a number of T-Beam poweroff display issues (#1876)
This commit is contained in:
parent
311835a231
commit
afafb3ba32
@ -233,14 +233,14 @@ bool Power::setup()
|
|||||||
|
|
||||||
void Power::shutdown()
|
void Power::shutdown()
|
||||||
{
|
{
|
||||||
|
screen->setOn(false);
|
||||||
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
||||||
digitalWrite(PIN_EINK_EN, LOW); //power off backlight first
|
digitalWrite(PIN_EINK_EN, LOW); //power off backlight first
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
DEBUG_MSG("Shutting down\n");
|
DEBUG_MSG("Shutting down\n");
|
||||||
if(PMU){
|
if(PMU) {
|
||||||
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
||||||
PMU->shutdown();
|
PMU->shutdown();
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ int32_t Power::runOnce()
|
|||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
||||||
// the IRQ status by reading the registers over I2C
|
// the IRQ status by reading the registers over I2C
|
||||||
if(PMU){
|
if(PMU) {
|
||||||
|
|
||||||
PMU->getIrqStatus();
|
PMU->getIrqStatus();
|
||||||
|
|
||||||
@ -344,10 +344,11 @@ int32_t Power::runOnce()
|
|||||||
if (PMU->isBatRemoveIrq()) {
|
if (PMU->isBatRemoveIrq()) {
|
||||||
DEBUG_MSG("Battery removed\n");
|
DEBUG_MSG("Battery removed\n");
|
||||||
}
|
}
|
||||||
if (PMU->isPekeyShortPressIrq()) {
|
|
||||||
DEBUG_MSG("PEK short button press\n");
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
if (PMU->isPekeyLongPressIrq()) {
|
||||||
|
DEBUG_MSG("PEK long button press\n");
|
||||||
|
screen->setOn(false);
|
||||||
|
}
|
||||||
|
|
||||||
PMU->clearIrqStatus();
|
PMU->clearIrqStatus();
|
||||||
}
|
}
|
||||||
@ -454,7 +455,6 @@ bool Power::axpChipInit()
|
|||||||
// Set constant current charging current
|
// Set constant current charging current
|
||||||
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
|
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
|
||||||
|
|
||||||
|
|
||||||
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
||||||
|
|
||||||
// t-beam s3 core
|
// t-beam s3 core
|
||||||
|
@ -131,8 +131,7 @@ class Screen : public concurrency::OSThread
|
|||||||
void setOn(bool on)
|
void setOn(bool on)
|
||||||
{
|
{
|
||||||
if (!on)
|
if (!on)
|
||||||
handleSetOn(
|
handleSetOn(false); // We handle off commands immediately, because they might be called because the CPU is shutting down
|
||||||
false); // We handle off commands immediately, because they might be called because the CPU is shutting down
|
|
||||||
else
|
else
|
||||||
enqueueCmd(ScreenCmd{.cmd = on ? Cmd::SET_ON : Cmd::SET_OFF});
|
enqueueCmd(ScreenCmd{.cmd = on ? Cmd::SET_ON : Cmd::SET_OFF});
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ void powerCommandsCheck()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARCH_NRF52)
|
#if defined(ARCH_NRF52) || defined(HAS_PMU)
|
||||||
if (shutdownAtMsec) {
|
if (shutdownAtMsec) {
|
||||||
screen->startShutdownScreen();
|
screen->startShutdownScreen();
|
||||||
playBeep();
|
playBeep();
|
||||||
|
Loading…
Reference in New Issue
Block a user