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

@@ -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;
}
}