Merge remote-tracking branch 'origin/develop' into mueller/master
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
#else
|
||||
#include "fsfw/osal/common/TcpTmTcServer.h"
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -21,12 +20,13 @@
|
||||
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#include "bsp_q7s/memory/scratchApi.h"
|
||||
#include "bsp_q7s/xadc/Xadc.h"
|
||||
|
||||
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
|
||||
CoreController::CoreController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5) {
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5), hkSet(this) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
try {
|
||||
result = initWatchdogFifo();
|
||||
@ -60,14 +60,23 @@ void CoreController::performControlOperation() {
|
||||
performWatchdogControlOperation();
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
readHkData();
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) { return nullptr; }
|
||||
LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) {
|
||||
if (sid.ownerSetId == core::HK_SET_ID) {
|
||||
return &hkSet;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initialize() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
@ -104,6 +113,7 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
setenv("PATH", updatedEnvPath.c_str(), true);
|
||||
updateProtInfo();
|
||||
initPrint();
|
||||
ExtendedControllerBase::initializeAfterTaskCreation();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1646,3 +1656,37 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C
|
||||
}
|
||||
rewriteRebootFile(rebootFile);
|
||||
}
|
||||
|
||||
void CoreController::readHkData() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT);
|
||||
if (result != RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
Xadc xadc;
|
||||
result = xadc.getTemperature(hkSet.temperature.value);
|
||||
if (result != RETURN_OK) {
|
||||
hkSet.temperature.setValid(false);
|
||||
} else {
|
||||
hkSet.temperature.setValid(true);
|
||||
}
|
||||
result = xadc.getVccPint(hkSet.psVoltage.value);
|
||||
if (result != RETURN_OK) {
|
||||
hkSet.psVoltage.setValid(false);
|
||||
} else {
|
||||
hkSet.psVoltage.setValid(true);
|
||||
}
|
||||
result = xadc.getVccInt(hkSet.plVoltage.value);
|
||||
if (result != RETURN_OK) {
|
||||
hkSet.plVoltage.setValid(false);
|
||||
} else {
|
||||
hkSet.plVoltage.setValid(true);
|
||||
}
|
||||
#if OBSW_PRINT_CORE_HK == 1
|
||||
hkSet.printSet();
|
||||
#endif /* OBSW_PRINT_CORE_HK == 1 */
|
||||
result = hkSet.commit(TIMEOUT_TYPE, MUTEX_TIMEOUT);
|
||||
if (result != RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user