IMTQ Updates #306

Merged
muellerr merged 13 commits from mueller/imtq-updates into develop 2022-10-25 13:12:19 +02:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit a5f2f3e8ea - Show all commits

View File

@ -33,6 +33,7 @@ void PayloadPcduHandler::doStartUp() {
if (pwrStateMachine.getState() == power::States::IDLE) { if (pwrStateMachine.getState() == power::States::IDLE) {
pwrStateMachine.start(MODE_ON, pwrSubmode); pwrStateMachine.start(MODE_ON, pwrSubmode);
} }
clearSetOnOffFlag = true;
auto opCode = pwrStateMachine.fsm(); auto opCode = pwrStateMachine.fsm();
if (opCode == power::OpCodes::TO_NOT_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { if (opCode == power::OpCodes::TO_NOT_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) {
pwrStateMachine.reset(); pwrStateMachine.reset();
@ -50,6 +51,11 @@ void PayloadPcduHandler::doShutDown() {
if (pwrStateMachine.getState() == power::States::IDLE) { if (pwrStateMachine.getState() == power::States::IDLE) {
pwrStateMachine.start(MODE_OFF, 0); pwrStateMachine.start(MODE_OFF, 0);
} }
if (clearSetOnOffFlag) {
std::memset(adcSet.processed.value, 0, adcSet.processed.getSerializedSize());
clearSetOnOffFlag = false;
}
auto opCode = pwrStateMachine.fsm(); auto opCode = pwrStateMachine.fsm();
if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) {
pwrStateMachine.reset(); pwrStateMachine.reset();

View File

@ -124,6 +124,7 @@ class PayloadPcduHandler : public DeviceHandlerBase {
bool txToMpaInjectionRequested = false; bool txToMpaInjectionRequested = false;
bool mpaToHpaInjectionRequested = false; bool mpaToHpaInjectionRequested = false;
bool allOnInjectRequested = false; bool allOnInjectRequested = false;
bool clearSetOnOffFlag = true;
PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); PeriodicOperationDivider opDivider = PeriodicOperationDivider(5);
uint8_t tempReadDivisor = 1; uint8_t tempReadDivisor = 1;