Fixes and Updates for EM build #468

Merged
meggert merged 11 commits from bugfixes_em_build into develop 2023-03-14 13:35:07 +01:00
11 changed files with 46 additions and 30 deletions
Showing only changes of commit e7811ebd0c - Show all commits

View File

@ -32,8 +32,13 @@ 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, 5), cmdExecutor(4096), cmdReplyBuf(4096, true), cmdRepliesSizes(128),
opDivider5(5), opDivider10(10), hkSet(this) {
: ExtendedControllerBase(objectId, 5),
cmdExecutor(4096),
cmdReplyBuf(4096, true),
cmdRepliesSizes(128),
opDivider5(5),
opDivider10(10),
hkSet(this) {
cmdExecutor.setRingBuffer(&cmdReplyBuf, &cmdRepliesSizes);
try {
sdcMan = SdCardManager::instance();
@ -102,14 +107,14 @@ void CoreController::performControlOperation() {
sdStateMachine();
performMountedSdCardOperations();
readHkData();
if(shellCmdIsExecuting) {
if (shellCmdIsExecuting) {
bool replyReceived = false;
// 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);
shellCmdIsExecuting = false;
cmdReplyBuf.clear();
while(not cmdRepliesSizes.empty()) {
while (not cmdRepliesSizes.empty()) {
cmdRepliesSizes.pop();
}
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
return actionReboot(data, size);
}
case(EXECUTE_SHELL_CMD): {
case (EXECUTE_SHELL_CMD): {
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;
}
cmdExecutor.load(cmd, false, false);
ReturnValue_t result = cmdExecutor.execute();
if(result != returnvalue::OK) {
if (result != returnvalue::OK) {
return result;
}
shellCmdIsExecuting = true;

View File

@ -7,9 +7,9 @@ GyroAdisDummy::GyroAdisDummy(object_id_t objectId, object_id_t comif, CookieIF *
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) {
return NOTHING_TO_SEND;

View File

@ -7,9 +7,9 @@ GyroL3GD20Dummy::GyroL3GD20Dummy(object_id_t objectId, object_id_t comif, Cookie
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) {
return NOTHING_TO_SEND;

View File

@ -7,9 +7,9 @@ ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCooki
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; }

View File

@ -7,9 +7,9 @@ MgmLIS3MDLDummy::MgmLIS3MDLDummy(object_id_t objectId, object_id_t comif, Cookie
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) {
return NOTHING_TO_SEND;

View File

@ -7,18 +7,22 @@ MgmRm3100Dummy::MgmRm3100Dummy(object_id_t objectId, object_id_t comif, CookieIF
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,
const uint8_t* commandData,
size_t commandDataLen) {
return OK;
return NOTHING_TO_SEND;
}
ReturnValue_t MgmRm3100Dummy::scanForReply(const uint8_t* start, size_t len,

View File

@ -5,9 +5,9 @@ SusDummy::SusDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
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; }

View File

@ -6,8 +6,10 @@ using namespace returnvalue;
Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: 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) {
return NOTHING_TO_SEND;
}

View File

@ -26,6 +26,8 @@
#include <dummies/SyrlinksDummy.h>
#include <fsfw_hal/common/gpio/GpioIF.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 "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);
ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds);
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
auto* strAssy = new StrAssembly(objects::STR_ASSY);
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
auto* strDummy =
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
strDummy->connectModeTreeParent(*strAssy);
if (cfg.addSyrlinksDummies) {
auto* syrlinksDummy =
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
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);
imtqDummy->enableThermalModule(ThermalStateCfg());
imtqDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
imtqDummy->connectModeTreeParent(*imtqAssy);
if (cfg.addPowerDummies) {
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);

View File

@ -49,7 +49,7 @@ void ActuatorCmd::cmdSpeedToRws(int32_t speedRw0, int32_t speedRw1, int32_t spee
} else if (rwCmdSpeed[i] < -maxRwSpeed) {
rwCmdSpeed[i] = -maxRwSpeed;
}
}
}
}
void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator,

View File

@ -49,7 +49,6 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::GET_READ);
#endif
// 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,
DeviceHandlerIF::PERFORM_OPERATION);
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,
DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ);
#endif
static_cast<void>(length);
return thisSequence->checkSequence();
}