Syrlinks Update #353

Merged
muellerr merged 24 commits from refactor_syrlinks into develop 2023-01-26 19:18:33 +01:00
Showing only changes of commit 693613037a - Show all commits

View File

@ -25,7 +25,7 @@ void SyrlinksHandler::doStartUp() {
} }
if (internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) { if (internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) {
if (commandExecuted) { if (commandExecuted) {
// Got to normal mode immediately and disable transmitter on startup. // Go to normal mode immediately and disable transmitter on startup.
setMode(_MODE_TO_NORMAL); setMode(_MODE_TO_NORMAL);
internalState = InternalState::IDLE; internalState = InternalState::IDLE;
commandExecuted = false; commandExecuted = false;
@ -35,14 +35,18 @@ void SyrlinksHandler::doStartUp() {
void SyrlinksHandler::doShutDown() { void SyrlinksHandler::doShutDown() {
// In any case, always disable TX first. // In any case, always disable TX first.
if (internalState != InternalState::SET_TX_STANDBY) {
internalState = InternalState::SET_TX_STANDBY; internalState = InternalState::SET_TX_STANDBY;
commandExecuted = false; commandExecuted = false;
}
if (internalState == InternalState::SET_TX_STANDBY) {
if (commandExecuted) { if (commandExecuted) {
temperatureSet.setValidity(false, true); temperatureSet.setValidity(false, true);
internalState = InternalState::OFF; internalState = InternalState::OFF;
commandExecuted = false; commandExecuted = false;
setMode(_MODE_POWER_DOWN); setMode(_MODE_POWER_DOWN);
} }
}
} }
ReturnValue_t SyrlinksHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t SyrlinksHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {