hopefully those were the last fixes
Some checks are pending
EIVE/eive-obsw/pipeline/pr-develop Build started...

This commit is contained in:
Robin Müller 2023-04-04 20:34:28 +02:00
parent f2a2c73984
commit 57b41701ce
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 20 additions and 9 deletions

View File

@ -62,9 +62,9 @@
#include "mission/system/acs/acsModeTree.h"
#include "mission/system/com/SyrlinksFdir.h"
#include "mission/system/com/comModeTree.h"
#include "mission/system/power/GomspacePowerFdir.h"
#include "mission/system/fdir/RtdFdir.h"
#include "mission/system/objects/TcsBoardAssembly.h"
#include "mission/system/power/GomspacePowerFdir.h"
#include "mission/system/tree/payloadModeTree.h"
#include "mission/system/tree/tcsModeTree.h"
#include "mission/tmtc/tmFilters.h"

View File

@ -28,7 +28,8 @@ void SyrlinksHandler::doStartUp() {
if (commandExecuted) {
// Go to normal mode immediately and disable transmitter on startup.
setMode(_MODE_TO_ON);
internalState = InternalState::TX_TRANSITION;
internalState = InternalState::IDLE;
transState = TransitionState::IDLE;
commandExecuted = false;
}
}
@ -99,7 +100,7 @@ ReturnValue_t SyrlinksHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
}
ReturnValue_t SyrlinksHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
if(transState == TransitionState::CMD_PENDING or transState == TransitionState::DONE) {
if (transState == TransitionState::CMD_PENDING or transState == TransitionState::DONE) {
return NOTHING_TO_SEND;
}
switch (internalState) {
@ -761,11 +762,13 @@ void SyrlinksHandler::setDebugMode(bool enable) { this->debugMode = enable; }
void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
Mode_t tgtMode = getBaseMode(getMode());
if (transState == TransitionState::DONE) {
auto doneHandler = [&]() {
internalState = InternalState::IDLE;
transState = TransitionState::IDLE;
DeviceHandlerBase::doTransition(modeFrom, subModeFrom);
return;
};
if (transState == TransitionState::DONE) {
return doneHandler();
}
auto txStandbyHandler = [&]() {
txDataset.setReportingEnabled(false);
@ -777,13 +780,20 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
txDataset.setReportingEnabled(true);
poolManager.changeCollectionInterval(txDataset.getSid(), 10.0);
poolManager.changeCollectionInterval(temperatureSet.getSid(), 5.0);
internalState = InternalState::TX_TRANSITION;
transState = tgtTransitionState;
internalState = InternalState::TX_TRANSITION;
};
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
if(getSubmode() == subModeFrom) {
DeviceHandlerBase::doTransition(modeFrom, subModeFrom);
// If submode has not changed, no special transition handling necessary.
if (getSubmode() == subModeFrom) {
return doneHandler();
}
// Transition is on-going, wait for it to finish.
if (transState != TransitionState::IDLE) {
return;
}
// Transition start logic.
switch (getSubmode()) {
case (com::Submode::RX_AND_TX_DEFAULT_DATARATE): {
auto currentDatarate = com::getCurrentDatarate();
@ -817,6 +827,7 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
}
} else if (tgtMode == HasModesIF::MODE_OFF) {
txStandbyHandler();
} else {
return doneHandler();
}
DeviceHandlerBase::doTransition(modeFrom, subModeFrom);
}