eive-obsw/mission/config/comCfg.cpp
Robin Mueller 13f3963f69
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
Update
- COM Subsystem now handles datarate config
- torquer config and comCfg moved to mission/config folder
- CCSDS Handler: Added default rate submode
2023-01-27 18:38:36 +01:00

27 lines
576 B
C++

#include "comCfg.h"
#include <fsfw/ipc/MutexFactory.h>
#include <fsfw/ipc/MutexGuard.h>
com::Datarate DATARATE_CFG_RAW = com::Datarate::LOW_RATE_MODULATION_BPSK;
MutexIF* DATARATE_LOCK = nullptr;
MutexIF* lazyLock();
com::Datarate com::getCurrentDatarate() {
MutexGuard mg(lazyLock());
return DATARATE_CFG_RAW;
}
void com::setCurrentDatarate(com::Datarate newRate) {
MutexGuard mg(lazyLock());
DATARATE_CFG_RAW = newRate;
}
MutexIF* lazyLock() {
if (DATARATE_LOCK == nullptr) {
return MutexFactory::instance()->createMutex();
}
return DATARATE_LOCK;
}