diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 7756fc6b..302cce0b 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -108,8 +108,8 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; - // DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; - DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; + DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; +// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; #if OBSW_TM_TO_PTME == 1 TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; @@ -942,10 +942,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, uart::PLOC_SUPERVISOR_BAUD, PLOC_SPV::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); - PlocSupervisorHandler* plocSupervisor = - new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, + new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF)); - plocSupervisor->setStartUpImmediately(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ static_cast(consumer); } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 57658518..bed4b025 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -44,11 +44,7 @@ ReturnValue_t PlocSupervisorHandler::initialize() { } void PlocSupervisorHandler::doStartUp() { -#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1 - setMode(MODE_NORMAL); -#else setMode(_MODE_TO_ON); -#endif uartIsolatorSwitch.pullHigh(); } @@ -384,6 +380,12 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r return result; } +ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) { + *numberOfSwitches = 1; + *switches = &powerSwitch; + return RETURN_OK; +} + ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { ReturnValue_t result = RETURN_OK; diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index b2db18b2..1830fee4 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -7,6 +7,7 @@ #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" #include "fsfw_hal/linux/gpio/Gpio.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" +#include "devices/powerSwitcherList.h" #include "OBSWConfig.h" @@ -122,6 +123,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { PLOC_SPV::BootStatusReport bootStatusReport; PLOC_SPV::LatchupStatusReport latchupStatusReport; + const power::Switch_t powerSwitch = pcduSwitches::PDU1_CH6_PLOC_12V; + /** Number of expected replies following the MRAM dump command */ uint32_t expectedMramDumpPackets = 0; uint32_t receivedMramDumpPackets = 0; @@ -144,6 +147,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { /** Setting this variable to true will enable direct downlink of MRAM packets */ bool downlinkMramDump = false; + ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches); + /** * @brief This function checks the crc of the received PLOC reply. *