bugfix for GPS handler #368

Merged
muellerr merged 11 commits from gps_bugfix into develop 2023-02-06 18:25:53 +01:00
10 changed files with 120 additions and 98 deletions
Showing only changes of commit 1a4dbce350 - Show all commits

View File

@@ -94,8 +94,8 @@ void GpsHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t
ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) {
while (true) { while (true) {
bool noDataRead = readGpsDataFromGpsd(); bool callAgain = readGpsDataFromGpsd();
if (noDataRead) { if (not callAgain) {
handleQueue(); handleQueue();
poolManager.performHkOperation(); poolManager.performHkOperation();
} }
@@ -137,7 +137,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCommandMessage(CommandMessage *m
return ExtendedControllerBase::handleCommandMessage(message); return ExtendedControllerBase::handleCommandMessage(message);
} }
#ifdef FSFW_OSAL_LINUX void GpsHyperionLinuxController::performControlOperation() {}
bool GpsHyperionLinuxController::readGpsDataFromGpsd() { bool GpsHyperionLinuxController::readGpsDataFromGpsd() {
auto readError = [&](int error) { auto readError = [&](int error) {
@@ -159,7 +159,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() {
} }
if (result == -1) { if (result == -1) {
readError(result); readError(result);
return false; return true;
} }
if (MODE_SET != (MODE_SET & gps.set)) { if (MODE_SET != (MODE_SET & gps.set)) {
if (mode == MODE_ON) { if (mode == MODE_ON) {
@@ -327,5 +327,3 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
} }
return returnvalue::OK; return returnvalue::OK;
} }
#endif

View File

@@ -67,9 +67,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
uint32_t timeIsConstantCounter = 0; uint32_t timeIsConstantCounter = 0;
Countdown timeUpdateCd = Countdown(60); Countdown timeUpdateCd = Countdown(60);
// Returns true if data was read and function should be called again // Returns true if the function should be called again or false if other
// immediately, and false if the gps_waiting blocked for 0.2 seconds // controller handling can be done.
// without new data arriving.
bool readGpsDataFromGpsd(); bool readGpsDataFromGpsd();
}; };