use power switcher to turn on supervisor
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-03-28 11:34:06 +02:00
parent a9a6bbd948
commit d6ed952fa9
3 changed files with 14 additions and 9 deletions

View File

@ -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<void>(consumer);
}

View File

@ -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;

View File

@ -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.
*