mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-23 07:32:27 +00:00
Add GPS read interval to sensor
Signed-off-by: Daniel Ekman <knegge@gmail.com>
This commit is contained in:
1 parent
1aa8ae90fb
commit
88a1cbfa04
1 file changed
+8
-2
@@ -68,6 +68,10 @@ static void applyRxPowerSavingConfig(NodePrefs& prefs, uint8_t sf, float bw) {
|
||||
#define SENSOR_READ_INTERVAL_SECS 60
|
||||
#endif
|
||||
|
||||
#ifndef GPS_READ_INTERVAL_SECS
|
||||
#define GPS_READ_INTERVAL_SECS 60
|
||||
#endif
|
||||
|
||||
/* ------------------------------ Code -------------------------------- */
|
||||
|
||||
#define FIRMWARE_VER_LEVEL 1
|
||||
@@ -203,8 +207,10 @@ uint8_t SensorMesh::handleRequest(uint8_t perms, uint32_t sender_timestamp, uint
|
||||
telemetry.reset();
|
||||
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
|
||||
// query other sensors -- target specific
|
||||
if (sensors.getLocationProvider() != NULL && sensors.getLocationProvider()->isPowerSavingEnabled()) {
|
||||
sensors.getLocationProvider()->syncTime(); // Request for GPS sync if GPS is in PowerSaving
|
||||
if (sensors.getLocationProvider() != NULL &&
|
||||
sensors.getLocationProvider()->isPowerSavingEnabled() &&
|
||||
getRTCClock()->getCurrentTime() - sensors.getLocationProvider()->getLastValidTimeSync() >= GPS_READ_INTERVAL_SECS)) {
|
||||
sensors.getLocationProvider()->syncTime(); // Request for GPS sync if GPS is in PowerSaving if later than read interval
|
||||
}
|
||||
sensors.querySensors(0xFF & perm_mask, telemetry); // allow all telemetry permissions for admin or guest
|
||||
// TODO: let requester know permissions they have: telemetry.addPresence(TELEM_CHANNEL_SELF, perms);
|
||||
|
||||
Reference in new issue
Block a user