run auto-formatter
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-03-28 13:54:46 +02:00
parent 1f12a249f5
commit e6ad0978de
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
7 changed files with 54 additions and 66 deletions

View File

@ -413,23 +413,23 @@ void initmission::createTestTasks(TaskFactory& factory,
} }
/** /**
â â
âŒâ∠ââââŒ
âŒââ∠ââââââ?
â?ââââââââââââââââââ?
âââââââââââââââˆââââˆââ?
âââââââââââââââââââˆâˆâââŒ
â?ââââââââââââââââââââââââŒ
âŒâââŒâˆâââââââââˆâââââââââˆââ?
â?ââââââââââââŒâˆâˆââââââââââââŒ
âŒââââˆâˆâââââââââââââââââââââŒ
âŒâââ?ââˆââˆâŒâââââââââââââââââââ?
â?âââ?ââ?âââââââââââââââââââââââŒ
â?âââââââââââââââââââââââââââ?
âŒââââââââââââââââââââââââââŒ
â?âââââââââââââââââââââââââ?
âââââââââââââââââââââââââŒ
ââââââââââââââââââââââ
ââââââââââââââââââ
ââââââââââââ
**/ **/

View File

@ -109,7 +109,7 @@ void Factory::setStaticFrameworkObjectIds() {
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; // DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
#if OBSW_TM_TO_PTME == 1 #if OBSW_TM_TO_PTME == 1
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
@ -915,8 +915,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
std::stringstream consumer; std::stringstream consumer;
#if OBSW_ADD_PLOC_MPSOC == 1 #if OBSW_ADD_PLOC_MPSOC == 1
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, consumer.str(), auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART,
Direction::OUT, Levels::HIGH); consumer.str(), Direction::OUT, Levels::HIGH);
auto mpsocGpioCookie = new GpioCookie; auto mpsocGpioCookie = new GpioCookie;
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie); gpioComIF->addGpios(mpsocGpioCookie);
@ -934,7 +934,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
#if OBSW_ADD_PLOC_SUPERVISOR == 1 #if OBSW_ADD_PLOC_SUPERVISOR == 1
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER; consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(), auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
Direction::OUT, Levels::HIGH); Direction::OUT, Levels::HIGH);
auto supvGpioCookie = new GpioCookie; auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
@ -943,7 +943,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
uart::PLOC_SUPERVISOR_BAUD, PLOC_SPV::MAX_PACKET_SIZE * 20); uart::PLOC_SUPERVISOR_BAUD, PLOC_SPV::MAX_PACKET_SIZE * 20);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
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)); supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF));
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer); static_cast<void>(consumer);
} }

View File

@ -7,8 +7,8 @@
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/ipc/QueueFactory.h" #include "fsfw/ipc/QueueFactory.h"
#include "fsfw/tmtcservices/SourceSequenceCounter.h" #include "fsfw/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h" #include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"

View File

@ -12,8 +12,7 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid, PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, CookieIF* comCookie, Gpio uartIsolatorSwitch)
Gpio uartIsolatorSwitch)
: DeviceHandlerBase(objectId, uartComIFid, comCookie), : DeviceHandlerBase(objectId, uartComIFid, comCookie),
uartIsolatorSwitch(uartIsolatorSwitch), uartIsolatorSwitch(uartIsolatorSwitch),
hkset(this), hkset(this),
@ -49,8 +48,8 @@ void PlocSupervisorHandler::doStartUp() {
} }
void PlocSupervisorHandler::doShutDown() { void PlocSupervisorHandler::doShutDown() {
setMode(_MODE_POWER_DOWN); setMode(_MODE_POWER_DOWN);
uartIsolatorSwitch.pullLow(); uartIsolatorSwitch.pullLow();
} }
ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
@ -380,10 +379,11 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r
return result; return result;
} }
ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) { ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t** switches,
*numberOfSwitches = 1; uint8_t* numberOfSwitches) {
*switches = &powerSwitch; *numberOfSwitches = 1;
return RETURN_OK; *switches = &powerSwitch;
return RETURN_OK;
} }
ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id,

View File

@ -1,15 +1,14 @@
#ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ #ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ #define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#include "bsp_q7s/memory/SdCardManager.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#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" #include "OBSWConfig.h"
#include "bsp_q7s/memory/SdCardManager.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
/** /**
* @brief This is the device handler for the supervisor of the PLOC which is programmed by * @brief This is the device handler for the supervisor of the PLOC which is programmed by
@ -147,7 +146,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
/** Setting this variable to true will enable direct downlink of MRAM packets */ /** Setting this variable to true will enable direct downlink of MRAM packets */
bool downlinkMramDump = false; bool downlinkMramDump = false;
ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches); ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches);
/** /**
* @brief This function checks the crc of the received PLOC reply. * @brief This function checks the crc of the received PLOC reply.

View File

@ -1,24 +1,16 @@
#include "DummyGpioIF.h" #include "DummyGpioIF.h"
DummyGpioIF::DummyGpioIF() { DummyGpioIF::DummyGpioIF() {}
}
DummyGpioIF::~DummyGpioIF() { DummyGpioIF::~DummyGpioIF() {}
}
ReturnValue_t DummyGpioIF::addGpios(GpioCookie* cookie) { ReturnValue_t DummyGpioIF::addGpios(GpioCookie* cookie) { return RETURN_OK; }
return RETURN_OK;
}
ReturnValue_t DummyGpioIF::pullHigh(gpioId_t gpioId) { ReturnValue_t DummyGpioIF::pullHigh(gpioId_t gpioId) { return RETURN_OK; }
return RETURN_OK;
}
ReturnValue_t DummyGpioIF::pullLow(gpioId_t gpioId) { ReturnValue_t DummyGpioIF::pullLow(gpioId_t gpioId) { return RETURN_OK; }
return RETURN_OK;
}
ReturnValue_t DummyGpioIF::readGpio(gpioId_t gpioId, int* gpioState) { ReturnValue_t DummyGpioIF::readGpio(gpioId_t gpioId, int* gpioState) {
*gpioState = 0; *gpioState = 0;
return RETURN_OK; return RETURN_OK;
} }

View File

@ -12,16 +12,13 @@
class Gpio { class Gpio {
public: public:
Gpio(gpioId_t gpioId, GpioIF* gpioIF) : gpioId(gpioId), gpioIF(gpioIF) { Gpio(gpioId_t gpioId, GpioIF* gpioIF) : gpioId(gpioId), gpioIF(gpioIF) {
if (gpioIF == nullptr) { if (gpioIF == nullptr) {
sif::error << "Gpio::Gpio: Invalid GpioIF" << std::endl; sif::error << "Gpio::Gpio: Invalid GpioIF" << std::endl;
} }
}
ReturnValue_t pullHigh() {
return gpioIF->pullHigh(gpioId);
}
ReturnValue_t pullLow() {
return gpioIF->pullLow(gpioId);
} }
ReturnValue_t pullHigh() { return gpioIF->pullHigh(gpioId); }
ReturnValue_t pullLow() { return gpioIF->pullLow(gpioId); }
private: private:
gpioId_t gpioId = gpio::NO_GPIO; gpioId_t gpioId = gpio::NO_GPIO;
GpioIF* gpioIF = nullptr; GpioIF* gpioIF = nullptr;