Merge pull request 'Extend Power Switch Handling' (#212) from mueller/extend-power-switch-handling into develop
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

Reviewed-on: #212
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
This commit is contained in:
Jakob Meier 2022-04-14 11:21:34 +02:00
commit 500c54e430
6 changed files with 25 additions and 9 deletions

View File

@ -160,7 +160,8 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_MGT == 1 #if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie = I2cCookie* imtqI2cCookie =
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V);
imtqHandler->setPowerSwitcher(pwrSwitcher); imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler); static_cast<void>(imtqHandler);
#if OBSW_DEBUG_IMTQ == 1 #if OBSW_DEBUG_IMTQ == 1
@ -628,14 +629,15 @@ void ObjectFactory::createSolarArrayDeploymentComponents() {
gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000); gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000);
} }
void ObjectFactory::createSyrlinksComponents() { void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
UartCookie* syrlinksUartCookie = UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD, new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven(); syrlinksUartCookie->setParityEven();
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF,
pcdu::PDU1_CH1_SYRLINKS_12V); syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V);
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
} }
void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {

View File

@ -24,7 +24,7 @@ void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher); PowerSwitchIF* pwrSwitcher);
void createHeaterComponents(); void createHeaterComponents();
void createSolarArrayDeploymentComponents(); void createSolarArrayDeploymentComponents();
void createSyrlinksComponents(); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
void createPayloadComponents(LinuxLibgpioIF* gpioComIF); void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);

2
fsfw

@ -1 +1 @@
Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b Subproject commit 186b3565e0eb6ca10ec2203febdbc7eb7e7f7fe0

@ -1 +1 @@
Subproject commit 9a92c7de0a2fedfcc638c0517e3edea123e977f8 Subproject commit 5ad9fb94af3312d29863527106396395f7b808a5

View File

@ -7,8 +7,10 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie) IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t pwrSwitcher)
: DeviceHandlerBase(objectId, comIF, comCookie), : DeviceHandlerBase(objectId, comIF, comCookie),
switcher(pwrSwitcher),
engHkDataset(this), engHkDataset(this),
calMtmMeasurementSet(this), calMtmMeasurementSet(this),
rawMtmMeasurementSet(this), rawMtmMeasurementSet(this),
@ -2178,3 +2180,12 @@ std::string IMTQHandler::makeStepString(const uint8_t step) {
} }
return stepString; return stepString;
} }
ReturnValue_t IMTQHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) {
if (switcher != power::NO_SWITCH) {
*numberOfSwitches = 1;
*switches = &switcher;
return RETURN_OK;
}
return DeviceHandlerBase::NO_SWITCH;
}

View File

@ -12,7 +12,8 @@
*/ */
class IMTQHandler : public DeviceHandlerBase { class IMTQHandler : public DeviceHandlerBase {
public: public:
IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t pwrSwitcher);
virtual ~IMTQHandler(); virtual ~IMTQHandler();
/** /**
@ -36,6 +37,7 @@ class IMTQHandler : public DeviceHandlerBase {
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override; LocalDataPoolManager& poolManager) override;
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) override;
private: private:
static const uint8_t INTERFACE_ID = CLASS_ID::IMTQ_HANDLER; static const uint8_t INTERFACE_ID = CLASS_ID::IMTQ_HANDLER;
@ -111,6 +113,7 @@ class IMTQHandler : public DeviceHandlerBase {
StartupStep startupStep = StartupStep::COMMAND_SELF_TEST; StartupStep startupStep = StartupStep::COMMAND_SELF_TEST;
power::Switch_t switcher = power::NO_SWITCH;
bool selfTestPerformed = false; bool selfTestPerformed = false;
/** /**