Only reset PTME on rate change #716

Merged
muellerr merged 10 commits from only-reset-ptme-on-rate-change into main 2023-06-29 14:56:37 +02:00
Showing only changes of commit 33985937b7 - Show all commits

View File

@ -246,13 +246,13 @@ 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) {
uint32_t currenRate = ptmeConfig.getRate(); uint32_t currentRate = ptmeConfig.getRate();
// Check whether the rate actually changes. // Check whether the rate actually changes.
if ((this->submode != submode) and if ((this->submode != submode) and
(((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW) and (((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW) and
(currenRate != RATE_100KBPS))) or (currentRate != RATE_100KBPS))) or
((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH) and ((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH) and
(currenRate != RATE_500KBPS))))) { (currentRate != RATE_500KBPS))))) {
initPtmeUpdateAfterXCycles(); initPtmeUpdateAfterXCycles();
updateContext.enableTransmitAfterPtmeUpdate = true; updateContext.enableTransmitAfterPtmeUpdate = true;
updateContext.updateClockRate = true; updateContext.updateClockRate = true;