GPS guard: save gps fence in the GPS prefs
This commit is contained in:
1 parent
faabf34950
commit
6291f9156a
5 files changed
+28
-2
No files matched your search
@@ -26,6 +26,8 @@ void CommonGpsPrefs::applyGuardReference(SensorManager& sensors) const {
|
||||
GpsGuard* guard = location != nullptr ? location->getGuard() : nullptr;
|
||||
double lat, lon;
|
||||
if (guard != nullptr && getGuardReference(lat, lon)) guard->setReference(lat, lon);
|
||||
uint32_t fence;
|
||||
if (guard != nullptr && getGuardFence(fence)) guard->setFence(fence);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -247,10 +249,11 @@ bool CommonGpsPrefs::handleCommand(const char* command, SensorManager& sensors,
|
||||
} else if (memcmp(command, "gps fence ", 10) == 0) {
|
||||
char* end;
|
||||
unsigned long metres = strtoul(command + 10, &end, 10);
|
||||
if (command[10] == ' | ||||