Fix NaN for Limiting Rotation Rates #872

Merged
meggert merged 17 commits from limit-rot-rate-fix into main 2024-03-06 11:13:02 +01:00
3 changed files with 16 additions and 5 deletions
Showing only changes of commit 85ed8420fd - Show all commits

View File

@ -481,7 +481,10 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
return returnvalue::OK;
}
case (UPDATE_LEAP_SECONDS): {
ReturnValue_t result = actionUpdateLeapSeconds();
if (size != 2) {
return HasActionsIF::INVALID_PARAMETERS;
}
ReturnValue_t result = actionUpdateLeapSeconds(data);
if (result != returnvalue::OK) {
return result;
}
@ -2101,7 +2104,7 @@ ReturnValue_t CoreController::initLeapSecondsFromFile() {
uint16_t leapSeconds = 0;
size_t checkPtr;
leapSeconds = std::stoi(nextWord.c_str(), &checkPtr, 10);
if (iss.bad() or *checkPtr) {
if (iss.bad() or checkPtr) {
return returnvalue::FAILED;
}
Clock::setLeapSeconds(leapSeconds);
@ -2121,7 +2124,15 @@ ReturnValue_t CoreController::writeLeapSecondsToFile(const uint16_t leapSeconds)
return returnvalue::FAILED;
};
ReturnValue_t CoreController::actionUpdateLeapSeconds() { ; }
ReturnValue_t CoreController::actionUpdateLeapSeconds(const uint8_t *data) {
uint16_t leapSeconds = data[1] | (data[0] << 8);
ReturnValue_t result = writeLeapSecondsToFile(leapSeconds);
if (result != returnvalue::OK) {
return result;
}
Clock::setLeapSeconds(leapSeconds);
return returnvalue::OK;
}
ReturnValue_t CoreController::initClockFromTimeFile() {
using namespace GpsHyperion;

View File

@ -340,7 +340,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
void initLeapSeconds();
ReturnValue_t initLeapSecondsFromFile();
ReturnValue_t initClockFromTimeFile();
ReturnValue_t actionUpdateLeapSeconds();
ReturnValue_t actionUpdateLeapSeconds(const uint8_t* data);
ReturnValue_t writeLeapSecondsToFile(const uint16_t leapSeconds);
ReturnValue_t performSdCardCheck();
ReturnValue_t backupTimeFileHandler();

2
tmtc

@ -1 +1 @@
Subproject commit 73a4260f337aa39475baef999466b200c9123e62
Subproject commit 811786fd78d5953956a8abba1c10c18c6e494422