fix and optimization
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-06-28 13:32:35 +02:00
parent b0a38136c1
commit eb27ab4bb0
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -246,7 +246,12 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
triggerEvent(CHANGING_MODE, mode, submode); triggerEvent(CHANGING_MODE, mode, submode);
if (mode == HasModesIF::MODE_ON) { if (mode == HasModesIF::MODE_ON) {
if (this->submode != submode) { // Check whether the rate actually changes.
if ((this->submode != submode) and
((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW) and
ptmeConfig.getRate() != RATE_100KBPS)) or
((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH) and
ptmeConfig.getRate() != RATE_500KBPS))) {
initPtmeUpdateAfterXCycles(); initPtmeUpdateAfterXCycles();
updateContext.enableTransmitAfterPtmeUpdate = true; updateContext.enableTransmitAfterPtmeUpdate = true;
updateContext.updateClockRate = true; updateContext.updateClockRate = true;
@ -255,7 +260,6 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
updateContext.setModeAfterUpdate = true; updateContext.setModeAfterUpdate = true;
return; return;
} }
if(ptmeConfig.setRate(bitRate))
// No rate change, so enable transmitter right away. // No rate change, so enable transmitter right away.
enableTransmit(); enableTransmit();
} else if (mode == HasModesIF::MODE_OFF) { } else if (mode == HasModesIF::MODE_OFF) {