linux/devices
mission
@ -16,7 +16,9 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, obj
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT),
|
||||
gpsSet(this),
|
||||
myGpsmm(GPSD_SHARED_MEMORY, nullptr),
|
||||
debugHyperionGps(debugHyperionGps) {}
|
||||
debugHyperionGps(debugHyperionGps) {
|
||||
timeUpdateCd.resetTimer();
|
||||
}
|
||||
|
||||
GPSHyperionLinuxController::~GPSHyperionLinuxController() {}
|
||||
|
||||
@ -180,10 +182,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
||||
timeIsConstantCounter = 0;
|
||||
}
|
||||
// If the received time does not change anymore for whatever reason, do not set it here
|
||||
// to avoid stale times
|
||||
if(timeIsConstantCounter < 3) {
|
||||
// to avoid stale times. Also, don't do it too often often to avoid jumping times
|
||||
if (timeIsConstantCounter < 3 and timeUpdateCd.hasTimedOut()) {
|
||||
// Update the system time here for now. NTP seems to be unable to do so for whatever reason
|
||||
settimeofday(&time, nullptr);
|
||||
timeUpdateCd.resetTimer();
|
||||
}
|
||||
|
||||
Clock::TimeOfDay_t timeOfDay = {};
|
||||
|
Reference in New Issue
Block a user