From 090ef880307e2de33a377b3063b260de2b94c82e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Mar 2023 17:53:02 +0100 Subject: [PATCH 1/9] EM obj factory fixes --- bsp_q7s/em/emObjectFactory.cpp | 15 ++++++++++++--- bsp_q7s/fmObjectFactory.cpp | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 8364533a..0958f3b2 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -23,8 +23,12 @@ void ObjectFactory::produce(void* args) { HealthTableIF* healthTable = nullptr; PusTmFunnel* pusFunnel = nullptr; CfdpTmFunnel* cfdpFunnel = nullptr; + StorageManagerIF* ipcStore = nullptr; + StorageManagerIF* tmStore = nullptr; + + PersistentTmStores stores; ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, - *SdCardManager::instance()); + *SdCardManager::instance(), &ipcStore, &tmStore, stores); LinuxLibgpioIF* gpioComIF = nullptr; SerialComIF* uartComIF = nullptr; @@ -98,11 +102,16 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ + #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; - createCcsdsComponents(gpioComIF, &ipCoreHandler); + CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, + &ipCoreHandler); + createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 - ObjectFactory::addTmtcIpCoresToFunnels(*ipCoreHandler, *pusFunnel, *cfdpFunnel); + if (ccsdsArgs.liveDestination != nullptr) { + pusFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0); + } #endif #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ /* Test Task */ diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 34a7c9dc..5daab861 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -77,6 +77,7 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ + #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, -- 2.43.0 From e7811ebd0cffc6c415040524d4291f1f5888a735 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Mar 2023 18:29:22 +0100 Subject: [PATCH 2/9] make system components work for EM --- bsp_q7s/core/CoreController.cpp | 22 ++++++++++++++-------- dummies/GyroAdisDummy.cpp | 4 ++-- dummies/GyroL3GD20Dummy.cpp | 4 ++-- dummies/ImtqDummy.cpp | 4 ++-- dummies/MgmLIS3MDLDummy.cpp | 4 ++-- dummies/MgmRm3100Dummy.cpp | 14 +++++++++----- dummies/SusDummy.cpp | 4 ++-- dummies/Tmp1075Dummy.cpp | 6 ++++-- dummies/helpers.cpp | 10 ++++++++-- mission/controller/acs/ActuatorCmd.cpp | 2 +- mission/core/pollingSeqTables.cpp | 2 -- 11 files changed, 46 insertions(+), 30 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 702264ab..085d27de 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -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; diff --git a/dummies/GyroAdisDummy.cpp b/dummies/GyroAdisDummy.cpp index ed581138..c7c40a1a 100644 --- a/dummies/GyroAdisDummy.cpp +++ b/dummies/GyroAdisDummy.cpp @@ -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; diff --git a/dummies/GyroL3GD20Dummy.cpp b/dummies/GyroL3GD20Dummy.cpp index 8c89f59d..ef2a7e59 100644 --- a/dummies/GyroL3GD20Dummy.cpp +++ b/dummies/GyroL3GD20Dummy.cpp @@ -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; diff --git a/dummies/ImtqDummy.cpp b/dummies/ImtqDummy.cpp index 9fcca838..01ec6457 100644 --- a/dummies/ImtqDummy.cpp +++ b/dummies/ImtqDummy.cpp @@ -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; } diff --git a/dummies/MgmLIS3MDLDummy.cpp b/dummies/MgmLIS3MDLDummy.cpp index 9038d963..0ce9a520 100644 --- a/dummies/MgmLIS3MDLDummy.cpp +++ b/dummies/MgmLIS3MDLDummy.cpp @@ -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; diff --git a/dummies/MgmRm3100Dummy.cpp b/dummies/MgmRm3100Dummy.cpp index fa5582c1..2c0c3f74 100644 --- a/dummies/MgmRm3100Dummy.cpp +++ b/dummies/MgmRm3100Dummy.cpp @@ -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, diff --git a/dummies/SusDummy.cpp b/dummies/SusDummy.cpp index d1129a49..75e36676 100644 --- a/dummies/SusDummy.cpp +++ b/dummies/SusDummy.cpp @@ -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; } diff --git a/dummies/Tmp1075Dummy.cpp b/dummies/Tmp1075Dummy.cpp index 9715a346..8cfede50 100644 --- a/dummies/Tmp1075Dummy.cpp +++ b/dummies/Tmp1075Dummy.cpp @@ -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; } diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index f93a8127..336738d2 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #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); diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index 457cacce..d2fe2d65 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -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, diff --git a/mission/core/pollingSeqTables.cpp b/mission/core/pollingSeqTables.cpp index 88b5b95a..79bf8868 100644 --- a/mission/core/pollingSeqTables.cpp +++ b/mission/core/pollingSeqTables.cpp @@ -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(length); return thisSequence->checkSequence(); } -- 2.43.0 From 853215e0dd52174b48c5483ce0f3608a1dc6076b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Mar 2023 18:37:07 +0100 Subject: [PATCH 3/9] always add TCS CTRL now --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb5b5b28..53f37dc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,7 @@ set(OBSW_TC_FROM_PDEC 1 CACHE STRING "Poll telecommand from PDEC IP core") set(OBSW_ADD_TCS_CTRL - ${INIT_VAL} + 1 CACHE STRING "Add TCS controllers") set(OBSW_ADD_HEATERS ${INIT_VAL} -- 2.43.0 From a1f6143b92e2d85063ec850cd32d19cc2af59358 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 10:54:44 +0100 Subject: [PATCH 4/9] almost reaching EIVE syste mmode for EM --- bsp_q7s/core/ObjectFactory.cpp | 47 ++++++++++++++++++------------- bsp_q7s/core/ObjectFactory.h | 1 + bsp_q7s/core/scheduling.cpp | 2 -- bsp_q7s/em/emObjectFactory.cpp | 6 ++++ bsp_q7s/fmObjectFactory.cpp | 4 +++ dummies/AcuDummy.cpp | 7 +++-- dummies/BpxDummy.cpp | 4 +-- dummies/BpxDummy.h | 8 +++--- dummies/P60DockDummy.cpp | 10 ++++--- dummies/PduDummy.cpp | 6 ++-- dummies/PlPcduDummy.cpp | 6 ++-- mission/core/pollingSeqTables.cpp | 43 ++++++++++++++-------------- tmtc | 2 +- 13 files changed, 83 insertions(+), 63 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3092e69d..bdccd6fd 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -68,6 +68,9 @@ #include "mission/tmtc/tmFilters.h" #include "mission/utility/GlobalConfigHandler.h" #include "tmtc/pusIds.h" + +using gpio::Direction; +using gpio::Levels; #if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" #endif @@ -254,106 +257,110 @@ ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF, return returnvalue::OK; } -void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, - SerialComIF* uartComIF, PowerSwitchIF& pwrSwitcher) { - using namespace gpio; - GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - +void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) { std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); + cookie.addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GYRO_1_L3G_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); + cookie.addGpio(gpioIds::GYRO_1_L3G_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); + cookie.addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GYRO_3_L3G_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); + cookie.addGpio(gpioIds::GYRO_3_L3G_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::MGM_0_LIS3_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); + cookie.addGpio(gpioIds::MGM_0_LIS3_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::MGM_1_RM3100_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); + cookie.addGpio(gpioIds::MGM_1_RM3100_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::MGM_2_LIS3_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); + cookie.addGpio(gpioIds::MGM_2_LIS3_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::MGM_3_RM3100_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_3_CS, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); + cookie.addGpio(gpioIds::MGM_3_RM3100_CS, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GPS_CONTROLLER; // GNSS reset pins are active low gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_0, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_NRESET, gpio); + cookie.addGpio(gpioIds::GNSS_0_NRESET, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GPS_CONTROLLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_1, consumer.str(), Direction::OUT, Levels::HIGH); - gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio); + cookie.addGpio(gpioIds::GNSS_1_NRESET, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER; // Enable pins must be pulled low for regular operations gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, consumer.str(), Direction::OUT, Levels::LOW); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio); + cookie.addGpio(gpioIds::GYRO_0_ENABLE, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ENABLE, consumer.str(), Direction::OUT, Levels::LOW); - gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio); + cookie.addGpio(gpioIds::GYRO_2_ENABLE, gpio); // Enable pins for GNSS consumer.str(""); consumer << "0x" << std::hex << objects::GPS_CONTROLLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), Direction::OUT, Levels::LOW); - gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_ENABLE, gpio); + cookie.addGpio(gpioIds::GNSS_0_ENABLE, gpio); consumer.str(""); consumer << "0x" << std::hex << objects::GPS_CONTROLLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), Direction::OUT, Levels::LOW); - gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio); + cookie.addGpio(gpioIds::GNSS_1_ENABLE, gpio); // Select pin. 0 for GPS side A, 1 for GPS side B consumer.str(""); consumer << "0x" << std::hex << objects::GPS_CONTROLLER; gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT, Levels::LOW); - gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio); + cookie.addGpio(gpioIds::GNSS_SELECT, gpio); +} + +void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, + SerialComIF* uartComIF, PowerSwitchIF& pwrSwitcher) { + using namespace gpio; + GpioCookie* gpioCookieAcsBoard = new GpioCookie(); + createAcsBoardGpios(*gpioCookieAcsBoard); gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board"); + AcsBoardFdir* fdir = nullptr; static_cast(fdir); diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 7b713005..c0da31d4 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -55,6 +55,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler); void createTmpComponents(); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler); +void createAcsBoardGpios(GpioCookie& cookie); void createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, PowerSwitchIF& pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable, diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 99bb90d2..90cd2173 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -501,7 +501,6 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction } #endif -#if OBSW_ADD_GOMSPACE_PCDU == 1 FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( "GS_PST_TASK", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); result = pst::pstGompaceCan(gomSpacePstTask); @@ -511,7 +510,6 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction } } taskVec.push_back(gomSpacePstTask); -#endif } void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 0958f3b2..501a5471 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,11 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); +#else + // Still add all GPIOs for EM. + GpioCookie* acsBoardGpios = new GpioCookie(); + createAcsBoardGpios(*acsBoardGpios); + gpioChecker(gpioComIF->addGpios(acsBoardGpios), "ACS Board"); #endif #if OBSW_ADD_MGT == 1 diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 5daab861..53f61528 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -104,3 +104,7 @@ void ObjectFactory::produce(void* args) { createAcsController(true); satsystem::init(); } + +void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) {} + +void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) {} diff --git a/dummies/AcuDummy.cpp b/dummies/AcuDummy.cpp index d6ba21d1..aa33a068 100644 --- a/dummies/AcuDummy.cpp +++ b/dummies/AcuDummy.cpp @@ -7,9 +7,9 @@ AcuDummy::AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) AcuDummy::~AcuDummy() {} -void AcuDummy::doStartUp() {} +void AcuDummy::doStartUp() { setMode(MODE_NORMAL); } -void AcuDummy::doShutDown() {} +void AcuDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t AcuDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } @@ -37,6 +37,7 @@ uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES, new PoolEntry(3)); + localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES, + new PoolEntry({10.0, 10.0, 10.0}, true)); return returnvalue::OK; } diff --git a/dummies/BpxDummy.cpp b/dummies/BpxDummy.cpp index 525c5c46..0770e9fc 100644 --- a/dummies/BpxDummy.cpp +++ b/dummies/BpxDummy.cpp @@ -7,9 +7,9 @@ BpxDummy::BpxDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) BpxDummy::~BpxDummy() {} -void BpxDummy::doStartUp() {} +void BpxDummy::doStartUp() { setMode(MODE_NORMAL); } -void BpxDummy::doShutDown() {} +void BpxDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t BpxDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } diff --git a/dummies/BpxDummy.h b/dummies/BpxDummy.h index 1332f36b..3c75cab7 100644 --- a/dummies/BpxDummy.h +++ b/dummies/BpxDummy.h @@ -34,10 +34,10 @@ class BpxDummy : public DeviceHandlerBase { PoolEntry dischargeCurrent = PoolEntry({0}); PoolEntry heaterCurrent = PoolEntry({0}); PoolEntry battVolt = PoolEntry({0}); - PoolEntry battTemp1 = PoolEntry({0}); - PoolEntry battTemp2 = PoolEntry({0}); - PoolEntry battTemp3 = PoolEntry({0}); - PoolEntry battTemp4 = PoolEntry({0}); + PoolEntry battTemp1 = PoolEntry({10}, true); + PoolEntry battTemp2 = PoolEntry({10}, true); + PoolEntry battTemp3 = PoolEntry({10}, true); + PoolEntry battTemp4 = PoolEntry({10}, true); PoolEntry rebootCounter = PoolEntry({0}); PoolEntry bootCause = PoolEntry({0}); PoolEntry battheatMode = PoolEntry({0}); diff --git a/dummies/P60DockDummy.cpp b/dummies/P60DockDummy.cpp index 8a3611ca..f4e4f9bb 100644 --- a/dummies/P60DockDummy.cpp +++ b/dummies/P60DockDummy.cpp @@ -7,9 +7,9 @@ P60DockDummy::P60DockDummy(object_id_t objectId, object_id_t comif, CookieIF *co P60DockDummy::~P60DockDummy() {} -void P60DockDummy::doStartUp() {} +void P60DockDummy::doStartUp() { setMode(MODE_NORMAL); } -void P60DockDummy::doShutDown() {} +void P60DockDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t P60DockDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; @@ -40,7 +40,9 @@ uint32_t P60DockDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { re ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, + new PoolEntry({10.0}, true)); + localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, + new PoolEntry({10.0}, true)); return returnvalue::OK; } diff --git a/dummies/PduDummy.cpp b/dummies/PduDummy.cpp index 42147222..4b1efff8 100644 --- a/dummies/PduDummy.cpp +++ b/dummies/PduDummy.cpp @@ -8,9 +8,9 @@ PduDummy::PduDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) PduDummy::~PduDummy() {} -void PduDummy::doStartUp() {} +void PduDummy::doStartUp() { setMode(MODE_NORMAL); } -void PduDummy::doShutDown() {} +void PduDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t PduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } @@ -38,7 +38,7 @@ uint32_t PduDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return ReturnValue_t PduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(PDU::pool::PDU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(PDU::pool::PDU_TEMPERATURE, new PoolEntry({10.0}, true)); localDataPoolMap.emplace(PDU::pool::PDU_VOLTAGES, &pduVoltages); localDataPoolMap.emplace(PDU::pool::PDU_CURRENTS, &pduCurrents); return returnvalue::OK; diff --git a/dummies/PlPcduDummy.cpp b/dummies/PlPcduDummy.cpp index df4acd1b..1366f63e 100644 --- a/dummies/PlPcduDummy.cpp +++ b/dummies/PlPcduDummy.cpp @@ -7,9 +7,9 @@ PlPcduDummy::PlPcduDummy(object_id_t objectId, object_id_t comif, CookieIF *comC PlPcduDummy::~PlPcduDummy() {} -void PlPcduDummy::doStartUp() {} +void PlPcduDummy::doStartUp() { setMode(MODE_NORMAL); } -void PlPcduDummy::doShutDown() {} +void PlPcduDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t PlPcduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; @@ -40,6 +40,6 @@ uint32_t PlPcduDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { ret ReturnValue_t PlPcduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry({0.0})); + localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry({0.0}, true)); return returnvalue::OK; } diff --git a/mission/core/pollingSeqTables.cpp b/mission/core/pollingSeqTables.cpp index 79bf8868..f8a34c36 100644 --- a/mission/core/pollingSeqTables.cpp +++ b/mission/core/pollingSeqTables.cpp @@ -40,36 +40,38 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); static_cast(length); -#if OBSW_ADD_BPX_BATTERY_HANDLER == 1 thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::SEND_READ); 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 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); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.45, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.45, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.55, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.55, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.65, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.65, + DeviceHandlerIF::GET_READ); // damaged /* thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, @@ -82,15 +84,16 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ); */ - thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.85, 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.85, + DeviceHandlerIF::GET_READ); static_cast(length); return thisSequence->checkSequence(); } @@ -549,7 +552,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, 0); -#if OBSW_ADD_PL_PCDU == 1 thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, @@ -560,7 +562,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::GET_READ); -#endif #if OBSW_ADD_RAD_SENSORS == 1 /* Radiation sensor */ diff --git a/tmtc b/tmtc index a40c881b..f21ee37a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a40c881b9fc292fe598204280db38720a784b71f +Subproject commit f21ee37a01379907ca72932264e5236a6c30f8a1 -- 2.43.0 From 192c7c6f31772f622d6e348d3e137a2b93cbf028 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 11:21:37 +0100 Subject: [PATCH 5/9] payload mode announce --- bsp_q7s/core/ObjectFactory.cpp | 8 +-- bsp_q7s/em/emObjectFactory.cpp | 5 +- dummies/CMakeLists.txt | 1 + dummies/PcduHandlerDummy.cpp | 62 +++++++++++++++++++++ dummies/PcduHandlerDummy.h | 39 +++++++++++++ dummies/helpers.cpp | 10 ++-- linux/ObjectFactory.cpp | 2 +- mission/CMakeLists.txt | 3 +- mission/payloadDefs.cpp | 32 +++++++++++ mission/payloadDefs.h | 24 ++++++++ mission/system/objects/PayloadSubsystem.cpp | 8 +++ mission/system/objects/PayloadSubsystem.h | 1 + mission/system/objects/definitions.h | 24 +------- mission/system/tree/payloadModeTree.cpp | 5 +- mission/system/tree/payloadModeTree.h | 4 +- mission/system/tree/system.cpp | 5 +- 16 files changed, 191 insertions(+), 42 deletions(-) create mode 100644 dummies/PcduHandlerDummy.cpp create mode 100644 dummies/PcduHandlerDummy.h create mode 100644 mission/payloadDefs.cpp create mode 100644 mission/payloadDefs.h diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index bdccd6fd..3afab7cd 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -613,7 +613,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit std::stringstream consumer; auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, pcdu::PDU2_CH8_PAYLOAD_CAMERA); - camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM); #if OBSW_ADD_PLOC_MPSOC == 1 consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, @@ -629,7 +629,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit auto* mpsocHandler = new PlocMPSoCHandler( objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF), objects::PLOC_SUPERVISOR_HANDLER); - mpsocHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + mpsocHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM); #endif /* OBSW_ADD_PLOC_MPSOC == 1 */ #if OBSW_ADD_PLOC_SUPERVISOR == 1 consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER; @@ -646,7 +646,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), pcdu::PDU1_CH6_PLOC_12V, *supvHelper); - supvHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + supvHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ static_cast(consumer); } @@ -901,7 +901,7 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* plPcduHandler->setToGoToNormalModeImmediately(true); plPcduHandler->enablePeriodicPrintout(true, 10); #endif - plPcduHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + plPcduHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM); } void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 501a5471..b82b0679 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -56,7 +58,8 @@ void ObjectFactory::produce(void* args) { PowerSwitchIF* pwrSwitcher = nullptr; #if OBSW_ADD_GOMSPACE_PCDU == 0 - pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); + auto* comCookieDummy = new ComCookieDummy(); + pwrSwitcher = new PcduHandlerDummy(objects::PCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); #else createPcduComponents(gpioComIF, &pwrSwitcher); #endif diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 41cb3328..75dd1364 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -7,6 +7,7 @@ target_sources( ComCookieDummy.cpp RwDummy.cpp Max31865Dummy.cpp + PcduHandlerDummy.cpp StarTrackerDummy.cpp SyrlinksDummy.cpp ImtqDummy.cpp diff --git a/dummies/PcduHandlerDummy.cpp b/dummies/PcduHandlerDummy.cpp new file mode 100644 index 00000000..15529fcf --- /dev/null +++ b/dummies/PcduHandlerDummy.cpp @@ -0,0 +1,62 @@ +#include "PcduHandlerDummy.h" + +#include + +PcduHandlerDummy::PcduHandlerDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie), dummySwitcher(objectId, 18, 18, false) {} + +PcduHandlerDummy::~PcduHandlerDummy() {} + +void PcduHandlerDummy::doStartUp() { setMode(MODE_NORMAL); } + +void PcduHandlerDummy::doShutDown() { setMode(MODE_OFF); } + +ReturnValue_t PcduHandlerDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PcduHandlerDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PcduHandlerDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t PcduHandlerDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t PcduHandlerDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return returnvalue::OK; +} + +void PcduHandlerDummy::fillCommandAndReplyMap() {} + +uint32_t PcduHandlerDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t PcduHandlerDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} + +ReturnValue_t PcduHandlerDummy::sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) { + return dummySwitcher.sendSwitchCommand(switchNr, onOff); +} + +ReturnValue_t PcduHandlerDummy::sendFuseOnCommand(uint8_t fuseNr) { + return dummySwitcher.sendFuseOnCommand(fuseNr); +} + +ReturnValue_t PcduHandlerDummy::getSwitchState(power::Switch_t switchNr) const { + return dummySwitcher.getSwitchState(switchNr); +} + +ReturnValue_t PcduHandlerDummy::getFuseState(uint8_t fuseNr) const { + return dummySwitcher.getFuseState(fuseNr); +} + +uint32_t PcduHandlerDummy::getSwitchDelayMs(void) const { return dummySwitcher.getSwitchDelayMs(); } diff --git a/dummies/PcduHandlerDummy.h b/dummies/PcduHandlerDummy.h new file mode 100644 index 00000000..2f4c167a --- /dev/null +++ b/dummies/PcduHandlerDummy.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include + +class PcduHandlerDummy : public DeviceHandlerBase, public PowerSwitchIF { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + PcduHandlerDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~PcduHandlerDummy(); + + protected: + DummyPowerSwitcher dummySwitcher; + + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; + + ReturnValue_t sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) override; + ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override; + ReturnValue_t getSwitchState(power::Switch_t switchNr) const override; + ReturnValue_t getFuseState(uint8_t fuseNr) const override; + uint32_t getSwitchDelayMs(void) const override; +}; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 336738d2..2959d42d 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -210,18 +210,18 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); - camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); - scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); auto* plPcduDummy = new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - plPcduDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + plPcduDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); if (cfg.addPlocDummies) { auto* plocMpsocDummy = new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - plocMpsocDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + plocMpsocDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - plocSupervisorDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + plocSupervisorDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); } } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 1ac86886..16ee9093 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -325,7 +325,7 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr if (switchId) { scexHandler->setPowerSwitcher(*pwrSwitcher, switchId.value()); } - scexHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + scexHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM); } AcsController* ObjectFactory::createAcsController(bool connectSubsystem) { diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index 37c4a2e2..bb1e800d 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -9,4 +9,5 @@ add_subdirectory(csp) add_subdirectory(cfdp) add_subdirectory(config) -target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp trace.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp payloadDefs.cpp + trace.cpp) diff --git a/mission/payloadDefs.cpp b/mission/payloadDefs.cpp new file mode 100644 index 00000000..b57f278a --- /dev/null +++ b/mission/payloadDefs.cpp @@ -0,0 +1,32 @@ +#include "payloadDefs.h" + +const char* payload::getModeStr(Mode mode) { + static const char* modeStr = "UNKNOWN"; + switch (mode) { + case (Mode::CAM_STREAM): { + modeStr = "CAM STREAM"; + break; + } + case (Mode::EARTH_OBSV): { + modeStr = "EARTH OBSV"; + break; + } + case (Mode::MPSOC_STREAM): { + modeStr = "MPSOC STREAM"; + break; + } + case (Mode::OFF): { + modeStr = "OFF"; + break; + } + case (Mode::SUPV_ONLY): { + modeStr = "SUPV ONLY"; + break; + } + case (Mode::SCEX): { + modeStr = "SCEX"; + break; + } + } + return modeStr; +} diff --git a/mission/payloadDefs.h b/mission/payloadDefs.h new file mode 100644 index 00000000..297ed87b --- /dev/null +++ b/mission/payloadDefs.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +namespace payload { + +enum Mode { + OFF = 0, + SUPV_ONLY = 10, + MPSOC_STREAM = 11, + CAM_STREAM = 12, + EARTH_OBSV = 13, + SCEX = 14 +}; + +extern const char* getModeStr(Mode mode); + +namespace ploc { + +enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 }; + +} + +} // namespace payload diff --git a/mission/system/objects/PayloadSubsystem.cpp b/mission/system/objects/PayloadSubsystem.cpp index 8bc98f0b..5cbd4459 100644 --- a/mission/system/objects/PayloadSubsystem.cpp +++ b/mission/system/objects/PayloadSubsystem.cpp @@ -1,5 +1,13 @@ #include "PayloadSubsystem.h" +#include "mission/payloadDefs.h" + PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} + +void PayloadSubsystem::announceMode(bool recursive) { + const char* modeStr = payload::getModeStr(static_cast(mode)); + sif::info << "PAYLOAD subsystem is now in " << modeStr << " mode" << std::endl; + Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/PayloadSubsystem.h b/mission/system/objects/PayloadSubsystem.h index af3c1efb..a4203f48 100644 --- a/mission/system/objects/PayloadSubsystem.h +++ b/mission/system/objects/PayloadSubsystem.h @@ -9,6 +9,7 @@ class PayloadSubsystem : public Subsystem { uint32_t maxNumberOfTables); private: + void announceMode(bool recursive) override; }; #endif /* MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_ */ diff --git a/mission/system/objects/definitions.h b/mission/system/objects/definitions.h index 80f30641..9e0176d9 100644 --- a/mission/system/objects/definitions.h +++ b/mission/system/objects/definitions.h @@ -1,5 +1,4 @@ -#ifndef MISSION_SYSTEM_DEFINITIONS_H_ -#define MISSION_SYSTEM_DEFINITIONS_H_ +#pragma once #include @@ -15,24 +14,3 @@ namespace duallane { enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 }; } // namespace duallane - -namespace payload { - -enum Mode { - OFF = 0, - SUPV_ONLY = 10, - MPSOC_STREAM = 11, - CAM_STREAM = 12, - EARTH_OBSV = 13, - SCEX = 14 -}; - -namespace ploc { - -enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 }; - -} - -} // namespace payload - -#endif /* MISSION_SYSTEM_DEFINITIONS_H_ */ diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index 5262c61e..0f955929 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -7,6 +7,7 @@ #include "eive/objects.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" +#include "mission/payloadDefs.h" #include "mission/system/objects/PayloadSubsystem.h" #include "mission/system/objects/definitions.h" #include "util.h" @@ -20,7 +21,7 @@ void initEarthObsvSequence(Subsystem& ss, ModeListEntry& eh); void initScexSequence(Subsystem& ss, ModeListEntry& eh); } // namespace -PayloadSubsystem satsystem::pl::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24); +PayloadSubsystem satsystem::payload::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24); const auto check = subsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; @@ -77,7 +78,7 @@ auto PL_TABLE_SCEX_TGT = auto PL_TABLE_SCEX_TRANS_0 = std::make_pair((payload::Mode::SCEX << 24) | 2, FixedArrayList()); -Subsystem& satsystem::pl::init() { +Subsystem& satsystem::payload::init() { ModeListEntry entry; initOffSequence(SUBSYSTEM, entry); initPlMpsocStreamSequence(SUBSYSTEM, entry); diff --git a/mission/system/tree/payloadModeTree.h b/mission/system/tree/payloadModeTree.h index 55cd6991..842746e4 100644 --- a/mission/system/tree/payloadModeTree.h +++ b/mission/system/tree/payloadModeTree.h @@ -5,12 +5,12 @@ namespace satsystem { -namespace pl { +namespace payload { extern PayloadSubsystem SUBSYSTEM; Subsystem& init(); -} // namespace pl +} // namespace payload } // namespace satsystem diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index dde32aef..2dd729d7 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -26,7 +26,7 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL; void satsystem::init() { auto& acsSubsystem = acs::init(); acsSubsystem.connectModeTreeParent(EIVE_SYSTEM); - auto& payloadSubsystem = pl::init(); + auto& payloadSubsystem = payload::init(); payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM); auto& tcsSubsystem = tcs::init(); tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM); @@ -87,8 +87,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); - // Build SAFE transition 0. Two transitions to reduce number of consecutive events and because - // consecutive commanding of TCS and ACS can lead to SPI issues. + // Build SAFE transition 0. iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_0.second); -- 2.43.0 From 1981c4f70a89b4e65d8c95ab4ccc05a272acd884 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 11:33:14 +0100 Subject: [PATCH 6/9] always schedule PL components --- bsp_q7s/core/scheduling.cpp | 2 -- dummies/PlocMpsocDummy.cpp | 4 ++-- dummies/PlocSupervisorDummy.cpp | 4 ++-- dummies/ScexDummy.cpp | 4 ++-- linux/scheduling.cpp | 4 ---- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 90cd2173..7ef9ad24 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -337,9 +337,7 @@ void scheduling::initTasks() { "PL_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); plTask->addComponent(objects::CAM_SWITCHER); scheduling::addMpsocSupvHandlers(plTask); -#if OBSW_ADD_SCEX_DEVICE == 1 scheduling::scheduleScexDev(plTask); -#endif #if OBSW_ADD_SCEX_DEVICE == 1 PeriodicTaskIF* scexReaderTask; diff --git a/dummies/PlocMpsocDummy.cpp b/dummies/PlocMpsocDummy.cpp index 2df55b1d..e1410ba1 100644 --- a/dummies/PlocMpsocDummy.cpp +++ b/dummies/PlocMpsocDummy.cpp @@ -5,9 +5,9 @@ PlocMpsocDummy::PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF PlocMpsocDummy::~PlocMpsocDummy() {} -void PlocMpsocDummy::doStartUp() {} +void PlocMpsocDummy::doStartUp() { setMode(MODE_ON); } -void PlocMpsocDummy::doShutDown() {} +void PlocMpsocDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; diff --git a/dummies/PlocSupervisorDummy.cpp b/dummies/PlocSupervisorDummy.cpp index d4730fe9..c3eea5b0 100644 --- a/dummies/PlocSupervisorDummy.cpp +++ b/dummies/PlocSupervisorDummy.cpp @@ -6,9 +6,9 @@ PlocSupervisorDummy::PlocSupervisorDummy(object_id_t objectId, object_id_t comif PlocSupervisorDummy::~PlocSupervisorDummy() {} -void PlocSupervisorDummy::doStartUp() {} +void PlocSupervisorDummy::doStartUp() { setMode(MODE_ON); } -void PlocSupervisorDummy::doShutDown() {} +void PlocSupervisorDummy::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t PlocSupervisorDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; diff --git a/dummies/ScexDummy.cpp b/dummies/ScexDummy.cpp index 303570ff..1f476064 100644 --- a/dummies/ScexDummy.cpp +++ b/dummies/ScexDummy.cpp @@ -5,9 +5,9 @@ ScexDummy::ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCooki ScexDummy::~ScexDummy() {} -void ScexDummy::doStartUp() {} +void ScexDummy::doStartUp() { setMode(MODE_ON); } -void ScexDummy::doShutDown() {} +void ScexDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t ScexDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } diff --git a/linux/scheduling.cpp b/linux/scheduling.cpp index 85394dea..85735729 100644 --- a/linux/scheduling.cpp +++ b/linux/scheduling.cpp @@ -27,7 +27,6 @@ void scheduling::scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexR } void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) { -#if OBSW_ADD_PLOC_SUPERVISOR == 1 plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_WRITE); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_WRITE); @@ -35,9 +34,7 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) { plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_READ); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ); -#endif -#if OBSW_ADD_PLOC_MPSOC == 1 plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_WRITE); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_WRITE); @@ -45,7 +42,6 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) { plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); -#endif } void scheduling::scheduleScexDev(PeriodicTaskIF*& scexDevHandler) { -- 2.43.0 From 870cc1da104b04f61d71cff119da62297ddd4ff8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 11:44:51 +0100 Subject: [PATCH 7/9] now it works --- CHANGELOG.md | 1 + dummies/helpers.cpp | 3 ++- fsfw | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be95f310..005cfd19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ will consitute of a breaking change warranting a new major release: - Pointing control of the `AcsController` was still expecting submodes instead of modes. - Limitation of RW speeds was done before converting them to the correct unit scale. - The Syrlinks task now has a proper name instead of `MAIN_SPI`. +- Make whole EIVE system initial transition work for the EM. # [v1.37.0] 2023-03-11 diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 2959d42d..2210e1bb 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -209,7 +209,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio tmp.second->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); } } - auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); + auto* camSwitcher = + new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, pcdu::Switches::PDU2_CH8_PAYLOAD_CAMERA); camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); diff --git a/fsfw b/fsfw index 9a8d775e..8382d61b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9a8d775eb1a8788ad844215bf2a42d9f707767c0 +Subproject commit 8382d61b9206c0259439eeddcad3759f1cd9bd2f -- 2.43.0 From a0fda428bfe85481459a2cfd426efaf0af2fca45 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 13:04:56 +0100 Subject: [PATCH 8/9] update changelog --- CHANGELOG.md | 3 ++- bsp_q7s/fmObjectFactory.cpp | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 005cfd19..7ca6cd03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,8 @@ will consitute of a breaking change warranting a new major release: - Pointing control of the `AcsController` was still expecting submodes instead of modes. - Limitation of RW speeds was done before converting them to the correct unit scale. - The Syrlinks task now has a proper name instead of `MAIN_SPI`. -- Make whole EIVE system initial transition work for the EM. +- Make whole EIVE system initial transition work for the EM. This was also made possible by + always scheduling most EIVE components instead of tying the scheduling to preprocessor defines. # [v1.37.0] 2023-03-11 diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 53f61528..5daab861 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -104,7 +104,3 @@ void ObjectFactory::produce(void* args) { createAcsController(true); satsystem::init(); } - -void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) {} - -void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) {} -- 2.43.0 From b59a84b3d5b04a27476ff1395d72fa0aaa4f9d6c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Mar 2023 13:07:22 +0100 Subject: [PATCH 9/9] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ca6cd03..528e0f9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ will consitute of a breaking change warranting a new major release: ## Added - Added `EXECUTE_SHELL_CMD` action command for `CoreController` to execute arbitrary Linux commands. +- Add `PcduHandlerDummy` component. ## Fixed @@ -28,6 +29,10 @@ will consitute of a breaking change warranting a new major release: - Make whole EIVE system initial transition work for the EM. This was also made possible by always scheduling most EIVE components instead of tying the scheduling to preprocessor defines. +## Changed + +- Set `OBSW_ADD_TCS_CTRL` to 1. Always add TCS controller now for both EM and FM. + # [v1.37.0] 2023-03-11 eive-tmtc: v2.18.1 -- 2.43.0