extend power switch handling
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2022-11-21 14:01:31 +01:00
parent 3eed1508fd
commit 0a5b79b8cd
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 18 additions and 6 deletions

View File

@ -38,13 +38,21 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_SYRLINKS == 1
dummyCfg.addSyrlinksDummies = false;
#endif
dummy::createDummies(dummyCfg);
#if OBSW_ADD_GOMSPACE_PCDU == 1
dummyCfg.addPowerDummies = false;
#endif
PowerSwitchIF* pwrSwitcher = nullptr;
#if OBSW_ADD_GOMSPACE_PCDU == 0
pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
#else
createPcduComponents(gpioComIF, &pwrSwitcher);
#endif
dummy::createDummies(dummyCfg, *pwrSwitcher);
new CoreController(objects::CORE_CONTROLLER);
PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
static_cast<void>(pwrSwitcher);
// Regular FM code, does not work for EM if the hardware is not connected
// createPcduComponents(gpioComIF, &pwrSwitcher);
// createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);

View File

@ -19,10 +19,11 @@
#include <dummies/SusDummy.h>
#include <dummies/SyrlinksDummy.h>
#include <dummies/TemperatureSensorsDummy.h>
#include <mission/system/objects/CamSwitcher.h>
using namespace dummy;
void dummy::createDummies(DummyCfg cfg) {
void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) {
new ComIFDummy(objects::DUMMY_COM_IF);
ComCookieDummy* comCookieDummy = new ComCookieDummy();
new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
@ -67,5 +68,6 @@ void dummy::createDummies(DummyCfg cfg) {
if (cfg.addTempSensorDummies) {
new TemperatureSensorsDummy();
}
new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH);
new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
}

View File

@ -1,5 +1,7 @@
#pragma once
#include <fsfw/power/PowerSwitchIF.h>
namespace dummy {
struct DummyCfg {
@ -12,6 +14,6 @@ struct DummyCfg {
bool addRtdComIFDummy = true;
};
void createDummies(DummyCfg cfg);
void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch);
} // namespace dummy