i dont think the default mode is required
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-01-26 14:52:58 +01:00
parent 4ad6584782
commit d8e191e5c3
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 15 additions and 13 deletions

View File

@ -25,7 +25,7 @@ void SyrlinksHandler::doStartUp() {
}
if (internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) {
if (commandExecuted) {
// Got to normal mode immediately.
// Got to normal mode immediately and disable transmitter on startup.
setMode(_MODE_TO_NORMAL);
internalState = InternalState::IDLE;
commandExecuted = false;
@ -740,6 +740,18 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
}
return false;
};
auto txStandbyHandler = [&]() {
if (internalState == InternalState::IDLE) {
internalState = InternalState::SET_TX_STANDBY;
commandExecuted = false;
}
if (internalState == InternalState::SET_TX_STANDBY) {
if (commandExecuted) {
commandDone();
return;
}
}
};
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
switch (getSubmode()) {
case (syrlinks::Submode::RX_AND_TX_DEFAULT_DATARATE): {
@ -768,17 +780,8 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
break;
}
case (syrlinks::Submode::RX_ONLY): {
if (internalState == InternalState::IDLE) {
internalState = InternalState::SET_TX_STANDBY;
commandExecuted = false;
}
if (internalState == InternalState::SET_TX_STANDBY) {
if (commandExecuted) {
commandDone();
return;
}
}
break;
txStandbyHandler();
return;
}
case (syrlinks::Submode::RX_AND_TX_CW): {
if (internalState == InternalState::IDLE) {

View File

@ -9,7 +9,6 @@ namespace syrlinks {
enum class ParameterId : uint8_t { DATARATE = 0 };
enum Submode {
DEFAULT,
RX_ONLY,
RX_AND_TX_DEFAULT_DATARATE,
RX_AND_TX_LOW_DATARATE,