Syrlinks Update #353

Merged
muellerr merged 24 commits from refactor_syrlinks into develop 2023-01-26 19:18:33 +01:00
2 changed files with 15 additions and 13 deletions
Showing only changes of commit d8e191e5c3 - Show all commits

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,