diff --git a/hal/src/fsfw_hal/linux/gpio/Gpio.h b/hal/src/fsfw_hal/linux/gpio/Gpio.h index 2ffe2146..40cc1df5 100644 --- a/hal/src/fsfw_hal/linux/gpio/Gpio.h +++ b/hal/src/fsfw_hal/linux/gpio/Gpio.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; diff --git a/src/fsfw/action/CommandActionHelper.h b/src/fsfw/action/CommandActionHelper.h index f0eac6d9..3b8acb04 100644 --- a/src/fsfw/action/CommandActionHelper.h +++ b/src/fsfw/action/CommandActionHelper.h @@ -18,8 +18,7 @@ class CommandActionHelper { virtual ~CommandActionHelper(); ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, const uint8_t* data = nullptr, uint32_t size = 0); - ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, - SerializeIF* data); + ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data); ReturnValue_t initialize(); ReturnValue_t handleReply(CommandMessage* reply); uint8_t getCommandCount() const; diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 6ae53f8c..b0a5d1f0 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -125,13 +125,14 @@ ReturnValue_t DeviceHandlerBase::initialize() { return result; } if (this->fdirInstance == nullptr) { - this->fdirInstance = new DeviceHandlerFailureIsolation(this->getObjectId(), defaultFdirParentId); + this->fdirInstance = + new DeviceHandlerFailureIsolation(this->getObjectId(), defaultFdirParentId); } - if(this->parent != objects::NO_OBJECT) { + if (this->parent != objects::NO_OBJECT) { HasModesIF* modeIF = ObjectManager::instance()->get(this->parent); HasHealthIF* healthIF = ObjectManager::instance()->get(this->parent); - if(modeIF != nullptr and healthIF != nullptr) { + if (modeIF != nullptr and healthIF != nullptr) { setParentQueue(modeIF->getCommandQueue()); } } @@ -361,14 +362,12 @@ void DeviceHandlerBase::doStateMachine() { } } break; case _MODE_WAIT_OFF: { - uint32_t currentUptime; - Clock::getUptime(¤tUptime); - if (powerSwitcher == nullptr) { setMode(MODE_OFF); break; } - + uint32_t currentUptime; + Clock::getUptime(¤tUptime); if (currentUptime - timeoutStart >= powerSwitcher->getSwitchDelayMs()) { triggerEvent(MODE_TRANSITION_FAILED, PowerSwitchIF::SWITCH_TIMEOUT, 0); setMode(MODE_ERROR_ON); @@ -467,16 +466,15 @@ size_t DeviceHandlerBase::getNextReplyLength(DeviceCommandId_t commandId) { DeviceCommandId_t replyId = NO_COMMAND_ID; DeviceCommandMap::iterator command = cookieInfo.pendingCommand; if (command->second.useAlternativeReplyId) { - replyId = command->second.alternativeReplyId; - } - else { - replyId = commandId; + replyId = command->second.alternativeReplyId; + } else { + replyId = commandId; } DeviceReplyIter iter = deviceReplyMap.find(replyId); if (iter != deviceReplyMap.end()) { - if (iter->second.delayCycles != 0) { - return iter->second.replyLen; - } + if (iter->second.delayCycles != 0) { + return iter->second.replyLen; + } } return 0; } @@ -1522,4 +1520,6 @@ void DeviceHandlerBase::setCustomFdir(FailureIsolationBase* fdir) { this->fdirIn void DeviceHandlerBase::setParent(object_id_t parent) { this->parent = parent; } -void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) { this->powerSwitcher = switcher; } +void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) { + this->powerSwitcher = switcher; +} diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index c9bb1aac..d8c3363e 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -103,9 +103,9 @@ class DeviceHandlerBase : public DeviceHandlerIF, DeviceHandlerBase(object_id_t setObjectId, object_id_t deviceCommunication, CookieIF *comCookie, FailureIsolationBase *fdirInstance = nullptr, size_t cmdQueueSize = 20); - void setCustomFdir(FailureIsolationBase* fdir); + void setCustomFdir(FailureIsolationBase *fdir); void setParent(object_id_t parent); - void setPowerSwitcher(PowerSwitchIF* switcher); + void setPowerSwitcher(PowerSwitchIF *switcher); void setHkDestination(object_id_t hkDestination); /** diff --git a/src/fsfw/power/PowerSwitchIF.h b/src/fsfw/power/PowerSwitchIF.h index 40ac3282..bc883fbc 100644 --- a/src/fsfw/power/PowerSwitchIF.h +++ b/src/fsfw/power/PowerSwitchIF.h @@ -1,7 +1,6 @@ #ifndef FSFW_POWER_POWERSWITCHIF_H_ #define FSFW_POWER_POWERSWITCHIF_H_ -#include "definitions.h" #include "../events/Event.h" #include "../returnvalues/HasReturnvaluesIF.h" #include "definitions.h" diff --git a/src/fsfw/power/PowerSwitcher.cpp b/src/fsfw/power/PowerSwitcher.cpp index 9e3263c6..7608c6e7 100644 --- a/src/fsfw/power/PowerSwitcher.cpp +++ b/src/fsfw/power/PowerSwitcher.cpp @@ -1,4 +1,3 @@ -#include "definitions.h" #include "fsfw/power/PowerSwitcher.h" #include "definitions.h"