From cbb8103278849ea4c818973ea6f8729eb2c983cf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 4 Mar 2022 18:33:23 +0100 Subject: [PATCH] some more bugfixes --- .../pollingSequenceFactory.cpp | 2 +- mission/system/AcsBoardAssembly.cpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 81d47a4b..73f00814 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -349,7 +349,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_ACS_BOARD == 1 && OBSW_ADD_ACS_HANDLERS == 1 - bool enableAside = false; + bool enableAside = true; bool enableBside = true; if (enableAside) { // A side diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index 5613e155..eb4afbd5 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -30,6 +30,9 @@ AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId, void AcsBoardAssembly::handleChildrenTransition() { if (state == States::SWITCHING_POWER) { powerStateMachine(targetMode, targetSubmode); + if (state == States::MODE_COMMANDING) { + AssemblyBase::handleChildrenTransition(); + } } else { AssemblyBase::handleChildrenTransition(); } @@ -72,26 +75,24 @@ ReturnValue_t AcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_ refreshHelperModes(); if (state == States::SWITCHING_POWER) { // Wrong mode - sif::error << "Wrong mode, currently swichting power" << std::endl; + sif::error << "Wrong mode, currently switching power" << std::endl; return RETURN_OK; } - if (submode == A_SIDE) { + if (wantedSubmode == A_SIDE) { if ((helper.gyro0SideAMode != wantedMode and helper.gyro1SideAMode != wantedMode) or (helper.mgm0SideAMode != wantedMode and helper.mgm1SideAMode != wantedMode) or helper.gpsMode != wantedMode) { - submode = B_SIDE; return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; } return RETURN_OK; - } else if (submode == B_SIDE) { + } else if (wantedSubmode == B_SIDE) { if ((helper.gyro2SideBMode != wantedMode and helper.gyro3SideBMode != wantedMode) or (helper.mgm2SideBMode != wantedMode and helper.mgm3SideBMode != wantedMode) or helper.gpsMode != wantedMode) { - submode = DUAL_MODE; return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; } return RETURN_OK; - } else if (submode == DUAL_MODE) { + } else if (wantedSubmode == DUAL_MODE) { if ((helper.gyro0SideAMode != wantedMode and helper.gyro1SideAMode != wantedMode and helper.gyro2AdisIdSideB != wantedMode and helper.gyro3SideBMode != wantedMode) or (helper.mgm0SideAMode != wantedMode and helper.mgm1SideAMode != wantedMode and @@ -115,7 +116,7 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s if (mode == DeviceHandlerIF::MODE_NORMAL) { if (isUseable(objectId, devMode)) { if (mode != MODE_OFF) { - modeTable[tableIdx].setMode(devMode); + modeTable[tableIdx].setMode(mode); modeTable[tableIdx].setSubmode(SUBMODE_NONE); } else { result = NEED_SECOND_STEP; @@ -123,14 +124,14 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s modeTable[tableIdx].setSubmode(SUBMODE_NONE); } } - } else if (devMode == MODE_ON) { + } else if (mode == MODE_ON) { if (isUseable(objectId, devMode)) { modeTable[tableIdx].setMode(MODE_ON); modeTable[tableIdx].setSubmode(SUBMODE_NONE); } } }; - switch (this->submode) { + switch (submode) { case (A_SIDE): { cmdSeq(helper.gyro0AdisIdSideA, helper.gyro0SideAMode, ModeTableIdx::GYRO_0_A); cmdSeq(helper.gyro1L3gIdSideA, helper.gyro1SideAMode, ModeTableIdx::GYRO_1_A);