diff --git a/CHANGELOG.md b/CHANGELOG.md index bf627b3a..b7f27fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ list yields a list of all related PRs for each release. - First version of ACS controller PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/329 +- Allow commanding the 5V stack internally in software + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/334 # [v1.18.0] 01.12.2022 diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index a1491044..23c6cc4f 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1323,7 +1323,7 @@ void CoreController::performRebootFileHandling(bool recreateFile) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl; #endif - rebootFile.enabled = true; + rebootFile.enabled = false; rebootFile.img00Cnt = 0; rebootFile.img01Cnt = 0; rebootFile.img10Cnt = 0; diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 74c9d02e..34da0257 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -33,8 +33,12 @@ void ObjectFactory::produce(void* args) { new CoreController(objects::CORE_CONTROLLER); createPcduComponents(gpioComIF, &pwrSwitcher); +#if OBSW_ADD_RAD_SENSORS == 1 createRadSensorComponent(gpioComIF); +#endif +#if OBSW_ADD_SUN_SENSORS == 1 createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); +#endif #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); diff --git a/fsfw b/fsfw index 5b0ea912..05cad893 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5b0ea91222a6b8efb2f4562cfecbcb735dfeedd5 +Subproject commit 05cad893a2b713827cf4cdc9afe49675f18afcc7 diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f9ea5926..ca030f1d 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -219,10 +219,9 @@ void AcsController::performDetumble() { { PoolReadGuard pg(&actuatorCmdData); if (pg.getReadResult() == returnvalue::OK) { - int32_t zeroVec[4] = {0, 0, 0, 0}; - std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(double)); + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); actuatorCmdData.rwTargetTorque.setValid(false); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetSpeed.setValid(false); std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); actuatorCmdData.mtqTargetDipole.setValid(true); @@ -468,7 +467,7 @@ void AcsController::copyMgmData() { PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); if (pg.getReadResult() == returnvalue::OK) { std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, - 3 + sizeof(float)); + 3 * sizeof(float)); mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); } } diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 91881db5..71b4734e 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -321,6 +321,11 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } + case pcdu::P60_DOCK_5V_STACK: { + memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_5V_STACK; + pdu = ObjectManager::instance()->get(objects::P60DOCK_HANDLER); + break; + } default: { sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index d2ffdc25..ca92f5e4 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -108,6 +108,8 @@ enum class SetIds : uint32_t { CORE = 1, AUX = 2, CONFIG = 3 }; namespace P60Dock { +static const uint16_t CONFIG_ADDRESS_OUT_EN_5V_STACK = 0x72; + namespace pool { enum Ids : lp_id_t { @@ -733,7 +735,9 @@ enum Switches : power::Switch_t { PDU2_CH5_DEPLOYMENT_MECHANISM_8V, PDU2_CH6_PL_PCDU_BATT_1_14V8, PDU2_CH7_ACS_BOARD_SIDE_B_3V3, - PDU2_CH8_PAYLOAD_CAMERA + PDU2_CH8_PAYLOAD_CAMERA, + + P60_DOCK_5V_STACK }; static constexpr uint8_t NUMBER_OF_SWITCHES = 18;