fixed bugs in com subsystem

This commit is contained in:
Jakob Meier 2023-02-22 09:53:09 +01:00
parent c64a490324
commit 018f93cfbe
3 changed files with 13 additions and 2 deletions

View File

@ -28,9 +28,10 @@ ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequence
void ComSubsystem::performChildOperation() {
readEventQueue();
if (mode != COM_SEQUENCE_RX_ONLY.first) {
if (countdownActive) {
checkTransmitterCountdown();
}
Subsystem::performChildOperation();
}
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
@ -112,10 +113,12 @@ void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
// disabled here
if (mode == COM_SEQUENCE_RX_ONLY.first) {
transmitterCountdown.timeOut();
countdownActive = false;
} else if ((mode == COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE.first) ||
(mode == COM_SEQUENCE_RX_AND_TX_LOW_RATE.first) ||
(mode == COM_SEQUENCE_RX_AND_TX_HIGH_RATE.first)) {
transmitterCountdown.resetTimer();
countdownActive = true;
}
Subsystem::startTransition(mode, submode);
}
@ -170,5 +173,6 @@ void ComSubsystem::startRxAndTxDefaultSeq() {
void ComSubsystem::checkTransmitterCountdown() {
if (transmitterCountdown.hasTimedOut()) {
startTransition(COM_SEQUENCE_RX_ONLY.first, SUBMODE_NONE);
countdownActive = false;
}
}

View File

@ -58,6 +58,10 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
// Countdown will be started as soon as the transmitter was enabled
Countdown transmitterCountdown;
// Transmitter countdown only active when sysrlinks transmitter is on (modes:
// rx and tx low rate, rx and tx high rate, rx and tx default rate)
bool countdownActive = false;
};
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */

View File

@ -11,7 +11,10 @@ extern ComSubsystem SUBSYSTEM;
// The syrlinks must not transmitting longer then 15 minutes otherwise the
// transceiver might be damaged due to overheating
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
// 15 minutes in milliseconds
//static const uint32_t TRANSMITTER_TIMEOUT = 900000;
static const uint32_t TRANSMITTER_TIMEOUT = 60000;
Subsystem& init();
} // namespace com