linux ctrl only print warning once
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#include "GPSHyperionLinuxController.h"
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
#include "fsfw/timemanager/Clock.h"
|
||||
#include "linux/utility/utility.h"
|
||||
@ -36,6 +37,7 @@ ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_
|
||||
uint32_t *msToReachTheMode) {
|
||||
if (not modeCommanded) {
|
||||
if (mode == MODE_ON or mode == MODE_OFF) {
|
||||
gpsNotOpenSwitch = true;
|
||||
// 5h time to reach fix
|
||||
*msToReachTheMode = MAX_SECONDS_TO_REACH_FIX;
|
||||
maxTimeToReachFix.resetTimer();
|
||||
@ -108,16 +110,22 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
||||
// The data from the device will generally be read all at once. Therefore, we
|
||||
// can set all field here
|
||||
if (not myGpsmm.is_open()) {
|
||||
// Opening failed
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Opening GPSMM failed" << std::endl;
|
||||
#endif
|
||||
if(gpsNotOpenSwitch) {
|
||||
// Opening failed
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Opening GPSMM failed" << std::endl;
|
||||
#endif
|
||||
gpsNotOpenSwitch = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
gps_data_t *gps = nullptr;
|
||||
gps = myGpsmm.read();
|
||||
if (gps == nullptr) {
|
||||
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed" << std::endl;
|
||||
if(gpsReadFailedSwitch) {
|
||||
gpsReadFailedSwitch = false;
|
||||
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed" << std::endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
PoolReadGuard pg(&gpsSet);
|
||||
|
@ -53,6 +53,8 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
||||
bool modeCommanded = true;
|
||||
bool timeInit = true;
|
||||
gpsmm myGpsmm;
|
||||
bool gpsNotOpenSwitch = true;
|
||||
bool gpsReadFailedSwitch = true;
|
||||
bool debugHyperionGps = false;
|
||||
uint32_t timeIsConstantCounter = 0;
|
||||
Countdown timeUpdateCd = Countdown(60);
|
||||
|
Reference in New Issue
Block a user