sforkowany z mirror/meshtastic-firmware
fix GPS fixme wrt deletion
rodzic
58715f454c
commit
217bd934d7
|
@ -73,6 +73,13 @@ bool GPS::setup()
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GPS::~GPS()
|
||||||
|
{
|
||||||
|
// we really should unregister our sleep observer
|
||||||
|
notifySleepObserver.unobserve();
|
||||||
|
notifyDeepSleepObserver.unobserve();
|
||||||
|
}
|
||||||
|
|
||||||
// Allow defining the polarity of the WAKE output. default is active high
|
// Allow defining the polarity of the WAKE output. default is active high
|
||||||
#ifndef GPS_WAKE_ACTIVE
|
#ifndef GPS_WAKE_ACTIVE
|
||||||
#define GPS_WAKE_ACTIVE 1
|
#define GPS_WAKE_ACTIVE 1
|
||||||
|
@ -86,8 +93,8 @@ void GPS::wake()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPS::sleep()
|
||||||
void GPS::sleep() {
|
{
|
||||||
#ifdef PIN_GPS_WAKE
|
#ifdef PIN_GPS_WAKE
|
||||||
digitalWrite(PIN_GPS_WAKE, GPS_WAKE_ACTIVE ? 0 : 1);
|
digitalWrite(PIN_GPS_WAKE, GPS_WAKE_ACTIVE ? 0 : 1);
|
||||||
pinMode(PIN_GPS_WAKE, OUTPUT);
|
pinMode(PIN_GPS_WAKE, OUTPUT);
|
||||||
|
@ -158,7 +165,8 @@ uint32_t GPS::getWakeTime() const
|
||||||
return t; // already maxint
|
return t; // already maxint
|
||||||
|
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
t = radioConfig.preferences.is_router ? 5 * 60 : 15 * 60; // Allow up to 15 mins for each attempt (probably will be much less if we can find sats) or less if a router
|
t = radioConfig.preferences.is_router ? 5 * 60 : 15 * 60; // Allow up to 15 mins for each attempt (probably will be much
|
||||||
|
// less if we can find sats) or less if a router
|
||||||
|
|
||||||
t *= 1000; // msecs
|
t *= 1000; // msecs
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class GPS : private concurrency::OSThread
|
||||||
|
|
||||||
GPS() : concurrency::OSThread("GPS") {}
|
GPS() : concurrency::OSThread("GPS") {}
|
||||||
|
|
||||||
virtual ~GPS() {} // FIXME, we really should unregister our sleep observer
|
virtual ~GPS();
|
||||||
|
|
||||||
/** We will notify this observable anytime GPS state has changed meaningfully */
|
/** We will notify this observable anytime GPS state has changed meaningfully */
|
||||||
Observable<const meshtastic::GPSStatus *> newStatus;
|
Observable<const meshtastic::GPSStatus *> newStatus;
|
||||||
|
|
Ładowanie…
Reference in New Issue