fixed bugs in com subsystem
This commit is contained in:
parent
c64a490324
commit
018f93cfbe
@ -28,9 +28,10 @@ ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequence
|
|||||||
|
|
||||||
void ComSubsystem::performChildOperation() {
|
void ComSubsystem::performChildOperation() {
|
||||||
readEventQueue();
|
readEventQueue();
|
||||||
if (mode != COM_SEQUENCE_RX_ONLY.first) {
|
if (countdownActive) {
|
||||||
checkTransmitterCountdown();
|
checkTransmitterCountdown();
|
||||||
}
|
}
|
||||||
|
Subsystem::performChildOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
|
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
|
||||||
@ -112,10 +113,12 @@ void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
|
|||||||
// disabled here
|
// disabled here
|
||||||
if (mode == COM_SEQUENCE_RX_ONLY.first) {
|
if (mode == COM_SEQUENCE_RX_ONLY.first) {
|
||||||
transmitterCountdown.timeOut();
|
transmitterCountdown.timeOut();
|
||||||
|
countdownActive = false;
|
||||||
} else if ((mode == COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE.first) ||
|
} 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_LOW_RATE.first) ||
|
||||||
(mode == COM_SEQUENCE_RX_AND_TX_HIGH_RATE.first)) {
|
(mode == COM_SEQUENCE_RX_AND_TX_HIGH_RATE.first)) {
|
||||||
transmitterCountdown.resetTimer();
|
transmitterCountdown.resetTimer();
|
||||||
|
countdownActive = true;
|
||||||
}
|
}
|
||||||
Subsystem::startTransition(mode, submode);
|
Subsystem::startTransition(mode, submode);
|
||||||
}
|
}
|
||||||
@ -170,5 +173,6 @@ void ComSubsystem::startRxAndTxDefaultSeq() {
|
|||||||
void ComSubsystem::checkTransmitterCountdown() {
|
void ComSubsystem::checkTransmitterCountdown() {
|
||||||
if (transmitterCountdown.hasTimedOut()) {
|
if (transmitterCountdown.hasTimedOut()) {
|
||||||
startTransition(COM_SEQUENCE_RX_ONLY.first, SUBMODE_NONE);
|
startTransition(COM_SEQUENCE_RX_ONLY.first, SUBMODE_NONE);
|
||||||
|
countdownActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,10 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
|||||||
|
|
||||||
// Countdown will be started as soon as the transmitter was enabled
|
// Countdown will be started as soon as the transmitter was enabled
|
||||||
Countdown transmitterCountdown;
|
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_ */
|
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */
|
||||||
|
@ -11,7 +11,10 @@ extern ComSubsystem SUBSYSTEM;
|
|||||||
|
|
||||||
// The syrlinks must not transmitting longer then 15 minutes otherwise the
|
// The syrlinks must not transmitting longer then 15 minutes otherwise the
|
||||||
// transceiver might be damaged due to overheating
|
// 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();
|
Subsystem& init();
|
||||||
} // namespace com
|
} // namespace com
|
||||||
|
Loading…
x
Reference in New Issue
Block a user