From e6ad0978ded44c0e5f8b2e16ed0e376fe57e4fd1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Mar 2022 13:54:46 +0200 Subject: [PATCH] run auto-formatter --- bsp_q7s/core/InitMission.cpp | 38 ++++++++++---------- bsp_q7s/core/ObjectFactory.cpp | 10 +++--- linux/devices/ploc/PlocMPSoCHandler.h | 2 +- linux/devices/ploc/PlocSupervisorHandler.cpp | 16 ++++----- linux/devices/ploc/PlocSupervisorHandler.h | 17 +++++---- test/gpio/DummyGpioIF.cpp | 22 ++++-------- test/gpio/GpioDummy.h | 15 ++++---- 7 files changed, 54 insertions(+), 66 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 1e963a9e..28890b9f 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -413,23 +413,23 @@ void initmission::createTestTasks(TaskFactory& factory, } /** - â–„ â–„ - ▌▒█ ▄▀▒▌ - ▌▒▒█ ▄▀▒▒▒â–? - â–?▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒â–? - ▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒â–? - ▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌ - â–?▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌ - ▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒â–? - â–?░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌ - ▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌ - ▌▒▀â–?▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒â–? - â–?â–’â–’â–?â–€â–?▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ - â–?▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒â–? - ▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌ - â–?â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–‘â–’â–‘â–’â–‘â–’â–’â–„â–’â–’â–? - ▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌ - ▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀ - ▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀ - ▒▒▒▒▒▒▒▒▒▒▀▀ + ▄ ▄ + ▌▒█ ▄▀▒▌ + ▌▒▒█ ▄▀▒▒▒▐ + ▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐ + ▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐ + ▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌ + ▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌ + ▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐ + ▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌ + ▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌ + ▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐ + ▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ + ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐ + ▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌ + ▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐ + ▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌ + ▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀ + ▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀ + ▒▒▒▒▒▒▒▒▒▒▀▀ **/ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 302cce0b..535c7460 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -109,7 +109,7 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; -// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; + // DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; #if OBSW_TM_TO_PTME == 1 TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; @@ -915,8 +915,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { std::stringstream consumer; #if OBSW_ADD_PLOC_MPSOC == 1 consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; - auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, consumer.str(), - Direction::OUT, Levels::HIGH); + auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, + consumer.str(), Direction::OUT, Levels::HIGH); auto mpsocGpioCookie = new GpioCookie; mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); gpioComIF->addGpios(mpsocGpioCookie); @@ -934,7 +934,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { #if OBSW_ADD_PLOC_SUPERVISOR == 1 consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER; auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(), - Direction::OUT, Levels::HIGH); + Direction::OUT, Levels::HIGH); auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); @@ -943,7 +943,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { uart::PLOC_SUPERVISOR_BAUD, PLOC_SPV::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); 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 */ static_cast(consumer); } diff --git a/linux/devices/ploc/PlocMPSoCHandler.h b/linux/devices/ploc/PlocMPSoCHandler.h index 135583f0..3b323109 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.h +++ b/linux/devices/ploc/PlocMPSoCHandler.h @@ -7,8 +7,8 @@ #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/ipc/QueueFactory.h" #include "fsfw/tmtcservices/SourceSequenceCounter.h" -#include "fsfw_hal/linux/uart/UartComIF.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/PlocMPSoCDefinitions.h" diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index bed4b025..838e090d 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -12,8 +12,7 @@ #include "OBSWConfig.h" PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid, - CookieIF* comCookie, - Gpio uartIsolatorSwitch) + CookieIF* comCookie, Gpio uartIsolatorSwitch) : DeviceHandlerBase(objectId, uartComIFid, comCookie), uartIsolatorSwitch(uartIsolatorSwitch), hkset(this), @@ -49,8 +48,8 @@ void PlocSupervisorHandler::doStartUp() { } void PlocSupervisorHandler::doShutDown() { - setMode(_MODE_POWER_DOWN); - uartIsolatorSwitch.pullLow(); + setMode(_MODE_POWER_DOWN); + uartIsolatorSwitch.pullLow(); } ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { @@ -380,10 +379,11 @@ 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::getSwitches(const uint8_t** switches, + uint8_t* numberOfSwitches) { + *numberOfSwitches = 1; + *switches = &powerSwitch; + return RETURN_OK; } ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id, diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 1830fee4..c3cfb44a 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -1,15 +1,14 @@ #ifndef 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 "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 @@ -147,7 +146,7 @@ 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); + ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches); /** * @brief This function checks the crc of the received PLOC reply. diff --git a/test/gpio/DummyGpioIF.cpp b/test/gpio/DummyGpioIF.cpp index 04c52b35..2db78eec 100644 --- a/test/gpio/DummyGpioIF.cpp +++ b/test/gpio/DummyGpioIF.cpp @@ -1,24 +1,16 @@ #include "DummyGpioIF.h" -DummyGpioIF::DummyGpioIF() { -} +DummyGpioIF::DummyGpioIF() {} -DummyGpioIF::~DummyGpioIF() { -} +DummyGpioIF::~DummyGpioIF() {} -ReturnValue_t DummyGpioIF::addGpios(GpioCookie* cookie) { - return RETURN_OK; -} +ReturnValue_t DummyGpioIF::addGpios(GpioCookie* cookie) { return RETURN_OK; } -ReturnValue_t DummyGpioIF::pullHigh(gpioId_t gpioId) { - return RETURN_OK; -} +ReturnValue_t DummyGpioIF::pullHigh(gpioId_t gpioId) { return RETURN_OK; } -ReturnValue_t DummyGpioIF::pullLow(gpioId_t gpioId) { - return RETURN_OK; -} +ReturnValue_t DummyGpioIF::pullLow(gpioId_t gpioId) { return RETURN_OK; } ReturnValue_t DummyGpioIF::readGpio(gpioId_t gpioId, int* gpioState) { - *gpioState = 0; - return RETURN_OK; + *gpioState = 0; + return RETURN_OK; } diff --git a/test/gpio/GpioDummy.h b/test/gpio/GpioDummy.h index 5c43975d..a849bae1 100644 --- a/test/gpio/GpioDummy.h +++ b/test/gpio/GpioDummy.h @@ -12,16 +12,13 @@ class Gpio { public: Gpio(gpioId_t gpioId, GpioIF* gpioIF) : gpioId(gpioId), gpioIF(gpioIF) { - if (gpioIF == nullptr) { - sif::error << "Gpio::Gpio: Invalid GpioIF" << std::endl; - } - } - ReturnValue_t pullHigh() { - return gpioIF->pullHigh(gpioId); - } - ReturnValue_t pullLow() { - return gpioIF->pullLow(gpioId); + if (gpioIF == nullptr) { + sif::error << "Gpio::Gpio: Invalid GpioIF" << std::endl; + } } + ReturnValue_t pullHigh() { return gpioIF->pullHigh(gpioId); } + ReturnValue_t pullLow() { return gpioIF->pullLow(gpioId); } + private: gpioId_t gpioId = gpio::NO_GPIO; GpioIF* gpioIF = nullptr;