make system components work for EM
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
090ef88030
commit
e7811ebd0c
@ -32,8 +32,13 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
|||||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||||
|
|
||||||
CoreController::CoreController(object_id_t objectId)
|
CoreController::CoreController(object_id_t objectId)
|
||||||
: ExtendedControllerBase(objectId, 5), cmdExecutor(4096), cmdReplyBuf(4096, true), cmdRepliesSizes(128),
|
: ExtendedControllerBase(objectId, 5),
|
||||||
opDivider5(5), opDivider10(10), hkSet(this) {
|
cmdExecutor(4096),
|
||||||
|
cmdReplyBuf(4096, true),
|
||||||
|
cmdRepliesSizes(128),
|
||||||
|
opDivider5(5),
|
||||||
|
opDivider10(10),
|
||||||
|
hkSet(this) {
|
||||||
cmdExecutor.setRingBuffer(&cmdReplyBuf, &cmdRepliesSizes);
|
cmdExecutor.setRingBuffer(&cmdReplyBuf, &cmdRepliesSizes);
|
||||||
try {
|
try {
|
||||||
sdcMan = SdCardManager::instance();
|
sdcMan = SdCardManager::instance();
|
||||||
@ -102,14 +107,14 @@ void CoreController::performControlOperation() {
|
|||||||
sdStateMachine();
|
sdStateMachine();
|
||||||
performMountedSdCardOperations();
|
performMountedSdCardOperations();
|
||||||
readHkData();
|
readHkData();
|
||||||
if(shellCmdIsExecuting) {
|
if (shellCmdIsExecuting) {
|
||||||
bool replyReceived = false;
|
bool replyReceived = false;
|
||||||
// TODO: We could read the data in the ring buffer and send it as an action data reply.
|
// TODO: We could read the data in the ring buffer and send it as an action data reply.
|
||||||
if(cmdExecutor.check(replyReceived) == CommandExecutor::EXECUTION_FINISHED) {
|
if (cmdExecutor.check(replyReceived) == CommandExecutor::EXECUTION_FINISHED) {
|
||||||
actionHelper.finish(true, successRecipient, EXECUTE_SHELL_CMD);
|
actionHelper.finish(true, successRecipient, EXECUTE_SHELL_CMD);
|
||||||
shellCmdIsExecuting = false;
|
shellCmdIsExecuting = false;
|
||||||
cmdReplyBuf.clear();
|
cmdReplyBuf.clear();
|
||||||
while(not cmdRepliesSizes.empty()) {
|
while (not cmdRepliesSizes.empty()) {
|
||||||
cmdRepliesSizes.pop();
|
cmdRepliesSizes.pop();
|
||||||
}
|
}
|
||||||
successRecipient = MessageQueueIF::NO_QUEUE;
|
successRecipient = MessageQueueIF::NO_QUEUE;
|
||||||
@ -316,14 +321,15 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
|||||||
// Warning: This function will never return, because it reboots the system
|
// Warning: This function will never return, because it reboots the system
|
||||||
return actionReboot(data, size);
|
return actionReboot(data, size);
|
||||||
}
|
}
|
||||||
case(EXECUTE_SHELL_CMD): {
|
case (EXECUTE_SHELL_CMD): {
|
||||||
std::string cmd = std::string(cmd, size);
|
std::string cmd = std::string(cmd, size);
|
||||||
if(cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or shellCmdIsExecuting) {
|
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
|
||||||
|
shellCmdIsExecuting) {
|
||||||
return HasActionsIF::IS_BUSY;
|
return HasActionsIF::IS_BUSY;
|
||||||
}
|
}
|
||||||
cmdExecutor.load(cmd, false, false);
|
cmdExecutor.load(cmd, false, false);
|
||||||
ReturnValue_t result = cmdExecutor.execute();
|
ReturnValue_t result = cmdExecutor.execute();
|
||||||
if(result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
shellCmdIsExecuting = true;
|
shellCmdIsExecuting = true;
|
||||||
|
@ -7,9 +7,9 @@ GyroAdisDummy::GyroAdisDummy(object_id_t objectId, object_id_t comif, CookieIF *
|
|||||||
|
|
||||||
GyroAdisDummy::~GyroAdisDummy() {}
|
GyroAdisDummy::~GyroAdisDummy() {}
|
||||||
|
|
||||||
void GyroAdisDummy::doStartUp() {}
|
void GyroAdisDummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void GyroAdisDummy::doShutDown() {}
|
void GyroAdisDummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t GyroAdisDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t GyroAdisDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
|
@ -7,9 +7,9 @@ GyroL3GD20Dummy::GyroL3GD20Dummy(object_id_t objectId, object_id_t comif, Cookie
|
|||||||
|
|
||||||
GyroL3GD20Dummy::~GyroL3GD20Dummy() {}
|
GyroL3GD20Dummy::~GyroL3GD20Dummy() {}
|
||||||
|
|
||||||
void GyroL3GD20Dummy::doStartUp() {}
|
void GyroL3GD20Dummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void GyroL3GD20Dummy::doShutDown() {}
|
void GyroL3GD20Dummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t GyroL3GD20Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t GyroL3GD20Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
|
@ -7,9 +7,9 @@ ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCooki
|
|||||||
|
|
||||||
ImtqDummy::~ImtqDummy() = default;
|
ImtqDummy::~ImtqDummy() = default;
|
||||||
|
|
||||||
void ImtqDummy::doStartUp() {}
|
void ImtqDummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void ImtqDummy::doShutDown() {}
|
void ImtqDummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
||||||
|
|
||||||
ReturnValue_t ImtqDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
|
ReturnValue_t ImtqDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ MgmLIS3MDLDummy::MgmLIS3MDLDummy(object_id_t objectId, object_id_t comif, Cookie
|
|||||||
|
|
||||||
MgmLIS3MDLDummy::~MgmLIS3MDLDummy() {}
|
MgmLIS3MDLDummy::~MgmLIS3MDLDummy() {}
|
||||||
|
|
||||||
void MgmLIS3MDLDummy::doStartUp() {}
|
void MgmLIS3MDLDummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void MgmLIS3MDLDummy::doShutDown() {}
|
void MgmLIS3MDLDummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t MgmLIS3MDLDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t MgmLIS3MDLDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
|
@ -7,18 +7,22 @@ MgmRm3100Dummy::MgmRm3100Dummy(object_id_t objectId, object_id_t comif, CookieIF
|
|||||||
|
|
||||||
MgmRm3100Dummy::~MgmRm3100Dummy() = default;
|
MgmRm3100Dummy::~MgmRm3100Dummy() = default;
|
||||||
|
|
||||||
void MgmRm3100Dummy::doStartUp() {}
|
void MgmRm3100Dummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void MgmRm3100Dummy::doShutDown() {}
|
void MgmRm3100Dummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t MgmRm3100Dummy::buildNormalDeviceCommand(DeviceCommandId_t* id) { return OK; }
|
ReturnValue_t MgmRm3100Dummy::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t MgmRm3100Dummy::buildTransitionDeviceCommand(DeviceCommandId_t* id) { return OK; }
|
ReturnValue_t MgmRm3100Dummy::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t MgmRm3100Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
ReturnValue_t MgmRm3100Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||||
const uint8_t* commandData,
|
const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
return OK;
|
return NOTHING_TO_SEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MgmRm3100Dummy::scanForReply(const uint8_t* start, size_t len,
|
ReturnValue_t MgmRm3100Dummy::scanForReply(const uint8_t* start, size_t len,
|
||||||
|
@ -5,9 +5,9 @@ SusDummy::SusDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
|||||||
|
|
||||||
SusDummy::~SusDummy() {}
|
SusDummy::~SusDummy() {}
|
||||||
|
|
||||||
void SusDummy::doStartUp() {}
|
void SusDummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
|
||||||
void SusDummy::doShutDown() {}
|
void SusDummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t SusDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
|
ReturnValue_t SusDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
|
||||||
|
|
||||||
|
@ -6,8 +6,10 @@ using namespace returnvalue;
|
|||||||
|
|
||||||
Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||||
: DeviceHandlerBase(objectId, comif, comCookie), set(this) {}
|
: DeviceHandlerBase(objectId, comif, comCookie), set(this) {}
|
||||||
void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); }
|
|
||||||
void Tmp1075Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
void Tmp1075Dummy::doStartUp() { setMode(MODE_NORMAL); }
|
||||||
|
void Tmp1075Dummy::doShutDown() { setMode(MODE_OFF); }
|
||||||
|
|
||||||
ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <dummies/SyrlinksDummy.h>
|
#include <dummies/SyrlinksDummy.h>
|
||||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||||
#include <mission/system/objects/CamSwitcher.h>
|
#include <mission/system/objects/CamSwitcher.h>
|
||||||
|
#include <mission/system/objects/ImtqAssembly.h>
|
||||||
|
#include <mission/system/objects/StrAssembly.h>
|
||||||
#include <mission/system/objects/TcsBoardAssembly.h>
|
#include <mission/system/objects/TcsBoardAssembly.h>
|
||||||
|
|
||||||
#include "TemperatureSensorInserter.h"
|
#include "TemperatureSensorInserter.h"
|
||||||
@ -56,17 +58,21 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
|
|||||||
rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
|
rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds);
|
ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds);
|
||||||
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
|
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
|
||||||
|
auto* strAssy = new StrAssembly(objects::STR_ASSY);
|
||||||
|
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
|
||||||
auto* strDummy =
|
auto* strDummy =
|
||||||
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
|
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
|
strDummy->connectModeTreeParent(*strAssy);
|
||||||
if (cfg.addSyrlinksDummies) {
|
if (cfg.addSyrlinksDummies) {
|
||||||
auto* syrlinksDummy =
|
auto* syrlinksDummy =
|
||||||
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||||
}
|
}
|
||||||
|
auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY);
|
||||||
|
imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
|
||||||
auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
imtqDummy->enableThermalModule(ThermalStateCfg());
|
imtqDummy->enableThermalModule(ThermalStateCfg());
|
||||||
imtqDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
|
imtqDummy->connectModeTreeParent(*imtqAssy);
|
||||||
if (cfg.addPowerDummies) {
|
if (cfg.addPowerDummies) {
|
||||||
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||||
|
@ -49,7 +49,7 @@ void ActuatorCmd::cmdSpeedToRws(int32_t speedRw0, int32_t speedRw1, int32_t spee
|
|||||||
} else if (rwCmdSpeed[i] < -maxRwSpeed) {
|
} else if (rwCmdSpeed[i] < -maxRwSpeed) {
|
||||||
rwCmdSpeed[i] = -maxRwSpeed;
|
rwCmdSpeed[i] = -maxRwSpeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator,
|
void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator,
|
||||||
|
@ -49,7 +49,6 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::GET_READ);
|
||||||
#endif
|
#endif
|
||||||
// These are actually part of another bus, but this works, so keep it like this for now
|
// These are actually part of another bus, but this works, so keep it like this for now
|
||||||
#if OBSW_ADD_TMP_DEVICES == 1
|
|
||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4,
|
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4,
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||||
@ -92,7 +91,6 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4,
|
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4,
|
||||||
DeviceHandlerIF::SEND_READ);
|
DeviceHandlerIF::SEND_READ);
|
||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||||
#endif
|
|
||||||
static_cast<void>(length);
|
static_cast<void>(length);
|
||||||
return thisSequence->checkSequence();
|
return thisSequence->checkSequence();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user