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

This commit is contained in:
2023-02-22 19:45:41 +01:00
parent 5357de8da8
commit a190d99f6d
11 changed files with 74 additions and 63 deletions

View File

@ -10,7 +10,6 @@
#include <utility>
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables, uint32_t transmitterTimeout)
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables), paramHelper(this) {
@ -116,11 +115,11 @@ void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
transmitterCountdown.timeOut();
countdownActive = false;
} else if (isTxMode(mode)) {
// Only start transmitter countdown if transmitter is not already on
if (not isTxMode(this->mode)) {
transmitterCountdown.resetTimer();
countdownActive = true;
}
// Only start transmitter countdown if transmitter is not already on
if (not isTxMode(this->mode)) {
transmitterCountdown.resetTimer();
countdownActive = true;
}
}
Subsystem::startTransition(mode, submode);
}
@ -190,10 +189,10 @@ void ComSubsystem::checkTransmitterCountdown() {
}
bool ComSubsystem::isTxMode(Mode_t mode) {
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||
(mode == com::Submode::RX_AND_TX_HIGH_DATARATE)) {
return true;
}
return false;
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||
(mode == com::Submode::RX_AND_TX_HIGH_DATARATE)) {
return true;
}
return false;
}

View File

@ -1,24 +1,25 @@
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
#include <fsfw/events/EventMessage.h>
#include <fsfw/parameters/HasParametersIF.h>
#include <fsfw/parameters/ParameterHelper.h>
#include <fsfw/subsystem/Subsystem.h>
#include <fsfw/events/EventMessage.h>
#include "mission/comDefs.h"
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
public:
/**
* @brief Constructor
*
* @param setObjectId
* @param maxNumberOfSequences
* @param maxNumberOfTables
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
* will be enabled
*/
/**
* @brief Constructor
*
* @param setObjectId
* @param maxNumberOfSequences
* @param maxNumberOfTables
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
* will be
* enabled
*/
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
uint32_t transmitterTimeout);
virtual ~ComSubsystem() = default;
@ -30,7 +31,6 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
virtual void performChildOperation() override;
private:
static const Mode_t INITIAL_MODE = 0;
ReturnValue_t handleCommandMessage(CommandMessage *message) override;
@ -40,7 +40,7 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
void startTransition(Mode_t mode, Submode_t submode) override;
void readEventQueue();
void handleEventMessage(EventMessage* eventMessage);
void handleEventMessage(EventMessage *eventMessage);
void handleBitLockEvent();
void handleCarrierLockEvent();
void checkTransmitterCountdown();
@ -56,11 +56,11 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
uint8_t datarateCfg = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK);
// Maximum time after which the transmitter will be turned of. This is a
// protection mechanism due prevent the syrlinks from overheating
uint32_t transmitterTimeout = 0;
// protection mechanism due prevent the syrlinks from overheating
uint32_t transmitterTimeout = 0;
ParameterHelper paramHelper;
MessageQueueIF* eventQueue = nullptr;
MessageQueueIF *eventQueue = nullptr;
bool enableTxWhenCarrierLock = false;