tweaks and logic fixes
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-02-06 10:30:17 +01:00
parent 4d6d4dd44d
commit 1a4dbce350
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 6 additions and 9 deletions

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();
}; };