implement transitions
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
fac688d4c9
commit
85d0ffed0d
@ -53,6 +53,7 @@ void FreshMpsocHandler::performDeviceOperation(uint8_t opCode) {
|
||||
void FreshMpsocHandler::performDefaultDeviceOperation() {
|
||||
handleQueue();
|
||||
if (transitionActive) {
|
||||
// TODO: Timeout handling for transitions.
|
||||
if (targetMode == MODE_ON or targetMode == MODE_NORMAL) {
|
||||
handleTransitionToOn();
|
||||
} else if (targetMode == MODE_OFF) {
|
||||
@ -276,7 +277,15 @@ ReturnValue_t FreshMpsocHandler::executeAction(ActionId_t actionId, MessageQueue
|
||||
* @overload
|
||||
* @param submode
|
||||
*/
|
||||
void FreshMpsocHandler::startTransition(Mode_t newMode, Submode_t submode) {}
|
||||
void FreshMpsocHandler::startTransition(Mode_t newMode, Submode_t submode) {
|
||||
// OFF commands are always accepted. Otherwise, ignore transition requests.
|
||||
if (transitionActive && newMode != HasModesIF::MODE_OFF) {
|
||||
return;
|
||||
}
|
||||
targetMode = newMode;
|
||||
targetSubmode = submode;
|
||||
transitionActive = true;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshMpsocHandler::performDeviceOperationPreQueueHandling(uint8_t opCode) {
|
||||
return returnvalue::OK;
|
||||
@ -293,6 +302,7 @@ void FreshMpsocHandler::handleTransitionToOn() {
|
||||
}
|
||||
if (startupState == StartupState::DONE) {
|
||||
setMode(MODE_ON);
|
||||
transitionActive = false;
|
||||
hkReport.setReportingEnabled(true);
|
||||
powerState = PowerState::IDLE;
|
||||
startupState = StartupState::IDLE;
|
||||
@ -303,6 +313,7 @@ void FreshMpsocHandler::handleTransitionToOff() {
|
||||
if (handleHwShutdown()) {
|
||||
hkReport.setReportingEnabled(false);
|
||||
setMode(MODE_OFF);
|
||||
transitionActive = false;
|
||||
// commandIsPending = false;
|
||||
// sequenceCount = 0;
|
||||
powerState = PowerState::IDLE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user