diff --git a/mission/com/CcsdsIpCoreHandler.cpp b/mission/com/CcsdsIpCoreHandler.cpp index 78533165..2e068add 100644 --- a/mission/com/CcsdsIpCoreHandler.cpp +++ b/mission/com/CcsdsIpCoreHandler.cpp @@ -246,12 +246,13 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { triggerEvent(CHANGING_MODE, mode, submode); if (mode == HasModesIF::MODE_ON) { + uint32_t currenRate = ptmeConfig.getRate(); // Check whether the rate actually changes. if ((this->submode != submode) and - ((submode == static_cast(com::CcsdsSubmode::DATARATE_LOW) and - ptmeConfig.getRate() != RATE_100KBPS)) or - ((submode == static_cast(com::CcsdsSubmode::DATARATE_HIGH) and - ptmeConfig.getRate() != RATE_500KBPS))) { + (((submode == static_cast(com::CcsdsSubmode::DATARATE_LOW) and + (currenRate != RATE_100KBPS))) or + ((submode == static_cast(com::CcsdsSubmode::DATARATE_HIGH) and + (currenRate != RATE_500KBPS))))) { initPtmeUpdateAfterXCycles(); updateContext.enableTransmitAfterPtmeUpdate = true; updateContext.updateClockRate = true;