mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-21 18:52:36 +10:00
Full T-echo card support + Compact UI (#11342)
* T-echo card * Update NRF52I2SOutput.cpp * Update NRF52I2SOutput.h * cleanup * Update buzz.cpp * use consistent runtime compact-panel check instead of mixing with compile-time macro * Update NodeDB.cpp * Update ExternalNotificationModule.cpp * switched to Throttle::isWithinTimespanMs * Update SharedUIDisplay.h * trunk fix * last cleanup * ClockRenderer.cpp for OLED_COMPACT_UI and setup Unit C6L for new UI. * Fixed regressions in standard OLED and TFT --------- Co-authored-by: Jason P <applewiz@mac.com>
This commit is contained in:
+28
-2
@@ -1183,6 +1183,7 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
||||
powerMon->setState(meshtastic_PowerMon_State_GPS_Active); // Report change for power monitoring (during testing)
|
||||
writePinEN(true); // Power (EN pin): on
|
||||
setPowerPMU(true); // Power (PMU): on
|
||||
writePinRFEN(true); // External RF front-end: on
|
||||
writePinStandby(false); // Standby (pin): awake (not standby)
|
||||
setPowerUBLOX(true); // Standby (UBLOX): awake
|
||||
break;
|
||||
@@ -1191,15 +1192,17 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
||||
powerMon->clearState(meshtastic_PowerMon_State_GPS_Active); // Report change for power monitoring (during testing)
|
||||
writePinEN(true); // Power (EN pin): on
|
||||
setPowerPMU(true); // Power (PMU): on
|
||||
writePinRFEN(false); // External RF front-end: off
|
||||
writePinStandby(true); // Standby (pin): asleep (not awake)
|
||||
setPowerUBLOX(false, sleepTime); // Standby (UBLOX): asleep, timed
|
||||
break;
|
||||
|
||||
case GPS_HARDSLEEP:
|
||||
powerMon->clearState(meshtastic_PowerMon_State_GPS_Active); // Report change for power monitoring (during testing)
|
||||
writePinRFEN(false); // External RF front-end: off
|
||||
writePinStandby(true); // Standby (pin): asleep (not awake)
|
||||
writePinEN(false); // Power (EN pin): off
|
||||
setPowerPMU(false); // Power (PMU): off
|
||||
writePinStandby(true); // Standby (pin): asleep (not awake)
|
||||
setPowerUBLOX(false, sleepTime); // Standby (UBLOX): asleep, timed
|
||||
#ifdef GNSS_AIROHA
|
||||
digitalWrite(PIN_GPS_EN, LOW);
|
||||
@@ -1209,9 +1212,10 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
||||
case GPS_OFF:
|
||||
assert(sleepTime == 0); // This is an indefinite sleep
|
||||
powerMon->clearState(meshtastic_PowerMon_State_GPS_Active); // Report change for power monitoring (during testing)
|
||||
writePinRFEN(false); // External RF front-end: off
|
||||
writePinStandby(true); // Standby (pin): asleep
|
||||
writePinEN(false); // Power (EN pin): off
|
||||
setPowerPMU(false); // Power (PMU): off
|
||||
writePinStandby(true); // Standby (pin): asleep
|
||||
setPowerUBLOX(false, 0); // Standby (UBLOX): asleep, indefinitely
|
||||
#ifdef GNSS_AIROHA
|
||||
digitalWrite(PIN_GPS_EN, LOW);
|
||||
@@ -1261,6 +1265,21 @@ void GPS::writePinStandby(bool standby)
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set the external RF front-end enable pin, if relevant
|
||||
void GPS::writePinRFEN(bool on)
|
||||
{
|
||||
#ifdef PIN_GPS_RF_EN
|
||||
bool val = on ? GPS_RF_EN_ACTIVE : !GPS_RF_EN_ACTIVE;
|
||||
pinMode(PIN_GPS_RF_EN, OUTPUT);
|
||||
digitalWrite(PIN_GPS_RF_EN, val);
|
||||
#ifdef GPS_DEBUG
|
||||
LOG_DEBUG("Pin RF EN %s", val == HIGH ? "HI" : "LOW");
|
||||
#endif
|
||||
#else
|
||||
(void)on;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Enable / Disable GPS with PMU, if present
|
||||
void GPS::setPowerPMU(bool on)
|
||||
{
|
||||
@@ -1390,6 +1409,13 @@ void GPS::down()
|
||||
if (IS_ONE_OF(gnssModel, GNSS_MODEL_UBLOX6, GNSS_MODEL_UBLOX7, GNSS_MODEL_UBLOX8, GNSS_MODEL_UBLOX9, GNSS_MODEL_UBLOX10))
|
||||
softsleepSupported = true;
|
||||
|
||||
#ifdef GPS_FORCE_SOFT_SLEEP
|
||||
if (softsleepSupported) {
|
||||
setPowerState(GPS_SOFTSLEEP, sleepTime);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (softsleepSupported) {
|
||||
// How long does gps_update_interval need to be, for GPS_HARDSLEEP to become more efficient than
|
||||
// GPS_SOFTSLEEP? Heuristic equation. A compromise manually fitted to power observations from U-blox NEO-6M
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
#define GPS_STANDBY_ACTIVE LOW
|
||||
#endif
|
||||
|
||||
// Allow defining the polarity of an external GPS RF front-end enable. Default is active high.
|
||||
#ifndef GPS_RF_EN_ACTIVE
|
||||
#define GPS_RF_EN_ACTIVE HIGH
|
||||
#endif
|
||||
|
||||
static constexpr uint32_t GPS_UPDATE_ALWAYS_ON_THRESHOLD_MS = 10 * 1000UL;
|
||||
static constexpr uint32_t GPS_FIX_HOLD_MAX_MS = 20000;
|
||||
|
||||
@@ -257,6 +262,10 @@ class GPS : private concurrency::OSThread
|
||||
*/
|
||||
void writePinStandby(bool standby);
|
||||
|
||||
/** Set the external RF front-end enable pin, if relevant
|
||||
*/
|
||||
void writePinRFEN(bool on);
|
||||
|
||||
/** Set GPS power with PMU, if relevant
|
||||
*/
|
||||
void setPowerPMU(bool on);
|
||||
|
||||
Reference in New Issue
Block a user