adapt EM SW: GS PCDU added, but use dummy for ACU

This commit is contained in:
Robin Müller 2023-04-28 10:18:46 +02:00
parent 9672d6d6cc
commit 6c326489cb
Signed by: muellerr
GPG Key ID: A649FB78196E3849
6 changed files with 20 additions and 5 deletions

View File

@ -146,8 +146,11 @@ set(OBSW_ADD_TMP_DEVICES
${INIT_VAL} ${INIT_VAL}
CACHE STRING "Add TMP devices") CACHE STRING "Add TMP devices")
set(OBSW_ADD_GOMSPACE_PCDU set(OBSW_ADD_GOMSPACE_PCDU
${INIT_VAL} 1
CACHE STRING "Add GomSpace PCDU modules") CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_GOMSPACE_ACU
${INIT_VAL}
CACHE STRING "Add GomSpace ACU submodule")
set(OBSW_ADD_RW set(OBSW_ADD_RW
${INIT_VAL} ${INIT_VAL}
CACHE STRING "Add RW modules") CACHE STRING "Add RW modules")

View File

@ -22,6 +22,9 @@
#define OBSW_COMMAND_SAFE_MODE_AT_STARTUP 1 #define OBSW_COMMAND_SAFE_MODE_AT_STARTUP 1
#define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@ #define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@
// This define is necessary because the EM setup has the P60 dock module, but no ACU on the P60
// module because it broke.
#define OBSW_ADD_GOMSPACE_ACU @OBSW_ADD_GOMSPACE_ACU@
#define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@

View File

@ -189,7 +189,6 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF,
*i2cComIF = new I2cComIF(objects::I2C_COM_IF); *i2cComIF = new I2cComIF(objects::I2C_COM_IF);
*uartComIF = new SerialComIF(objects::UART_COM_IF); *uartComIF = new SerialComIF(objects::UART_COM_IF);
*spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, **gpioComIF); *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, **gpioComIF);
//*spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, **gpioComIF);
} }
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher, void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher,
@ -197,7 +196,6 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_SIZE, addresses::P60DOCK, 500); CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_SIZE, addresses::P60DOCK, 500);
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_SIZE, addresses::PDU1, 500); CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_SIZE, addresses::PDU1, 500);
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_SIZE, addresses::PDU2, 500); CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_SIZE, addresses::PDU2, 500);
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_SIZE, addresses::ACU, 500);
auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER); auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER);
P60DockHandler* p60dockhandler = new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, P60DockHandler* p60dockhandler = new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF,
@ -211,9 +209,12 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
Pdu2Handler* pdu2handler = new Pdu2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, Pdu2Handler* pdu2handler = new Pdu2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF,
pdu2CspCookie, pdu2Fdir, enableHkSets); pdu2CspCookie, pdu2Fdir, enableHkSets);
#if OBSW_ADD_GOMSPACE_ACU == 1
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_SIZE, addresses::ACU, 500);
auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER); auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER);
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie,
acuFdir, enableHkSets); acuFdir, enableHkSets);
#endif
auto pcduHandler = new PcduHandler(objects::PCDU_HANDLER, 50); auto pcduHandler = new PcduHandler(objects::PCDU_HANDLER, 50);
/** /**
@ -223,7 +224,9 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
p60dockhandler->setModeNormal(); p60dockhandler->setModeNormal();
pdu1handler->setModeNormal(); pdu1handler->setModeNormal();
pdu2handler->setModeNormal(); pdu2handler->setModeNormal();
#if OBSW_ADD_GOMSPACE_ACU == 1
acuhandler->setModeNormal(); acuhandler->setModeNormal();
#endif
if (pwrSwitcher != nullptr) { if (pwrSwitcher != nullptr) {
*pwrSwitcher = pcduHandler; *pwrSwitcher = pcduHandler;
} }

View File

@ -56,6 +56,8 @@ void ObjectFactory::produce(void* args) {
#endif #endif
#if OBSW_ADD_GOMSPACE_PCDU == 1 #if OBSW_ADD_GOMSPACE_PCDU == 1
dummyCfg.addPowerDummies = false; dummyCfg.addPowerDummies = false;
// The ACU broke.
dummyCfg.addOnlyAcuDummy = true;
#endif #endif
#if OBSW_ADD_ACS_BOARD == 1 #if OBSW_ADD_ACS_BOARD == 1
dummyCfg.addAcsBoardDummies = false; dummyCfg.addAcsBoardDummies = false;
@ -89,7 +91,7 @@ void ObjectFactory::produce(void* args) {
// createRadSensorComponent(gpioComIF); // createRadSensorComponent(gpioComIF);
#if OBSW_ADD_ACS_BOARD == 1 #if OBSW_ADD_ACS_BOARD == 1
createAcsBoardComponents(*spiMainComIF, gpioComIF, uartComIF, *pwrSwitcher); createAcsBoardComponents(*spiMainComIF, gpioComIF, uartComIF, *pwrSwitcher, true);
#else #else
// Still add all GPIOs for EM. // Still add all GPIOs for EM.
GpioCookie* acsBoardGpios = new GpioCookie(); GpioCookie* acsBoardGpios = new GpioCookie();

View File

@ -75,8 +75,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
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(*imtqAssy); imtqDummy->connectModeTreeParent(*imtqAssy);
if (cfg.addPowerDummies) { if (cfg.addOnlyAcuDummy) {
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
} else if (cfg.addPowerDummies) {
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PduDummy(objects::PDU2_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU2_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new P60DockDummy(objects::P60DOCK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new P60DockDummy(objects::P60DOCK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);

View File

@ -6,8 +6,11 @@ class GpioIF;
namespace dummy { namespace dummy {
// Default values targeted towards EM.
struct DummyCfg { struct DummyCfg {
bool addCoreCtrlCfg = true; bool addCoreCtrlCfg = true;
// Special variant because the ACU broke. Overrides addPowerDummies, only ACU dummy will be added.
bool addOnlyAcuDummy = false;
bool addPowerDummies = true; bool addPowerDummies = true;
bool addSyrlinksDummies = true; bool addSyrlinksDummies = true;
bool addAcsBoardDummies = true; bool addAcsBoardDummies = true;