From d9514e418443c69809434925b23642d2175810d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:08:34 +0100 Subject: [PATCH] a lot of bugfixes --- CHANGELOG.md | 5 +++++ common/config/devices/addresses.h | 2 +- fsfw | 2 +- linux/ObjectFactory.cpp | 12 ++---------- mission/controller/AcsController.cpp | 2 +- mission/controller/AcsController.h | 1 + mission/system/tree/acsModeTree.h | 1 - 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0e4447..0ab1a83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,9 +24,14 @@ change warranting a new major release: - `AcsController`: Parameter fix in `DetumbleParameter`. - Set GPS set entries to invalid on MODE_OFF command. +- Bump FSFW for bugfix in `setNormalDatapoolEntriesInvalid` where the validity was not set to false + properly +- Regression: Revert swap of SUS0 and SUS6. Those devices are on separate power lines. In a + future fix, the calibration matrices of SUS0 and SUS6 will be swapped. ## Changed +- `ACS::SensorValues` is now an ACS controller member to reduce the risk of stack overflow. - ACS Subsystem Sequence Mode IDs updated. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/130 diff --git a/common/config/devices/addresses.h b/common/config/devices/addresses.h index d7056307..c1e65314 100644 --- a/common/config/devices/addresses.h +++ b/common/config/devices/addresses.h @@ -9,7 +9,7 @@ namespace addresses { /* Logical addresses have uint32_t datatype */ -enum logicalAddresses : address_t { +enum LogicAddress : address_t { PCDU, MGM_0_LIS3 = objects::MGM_0_LIS3_HANDLER, diff --git a/fsfw b/fsfw index 3250bbf2..38789e05 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3250bbf269b3326683222bb87ce7faecae63ad97 +Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index a147af26..cf27972f 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -79,11 +79,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #if OBSW_ADD_SUN_SENSORS == 1 SusFdir* fdir = nullptr; std::array susHandlers = {}; - gpioId_t gpioId = gpioIds::CS_SUS_0; - if (swap0And6) { - gpioId = gpioIds::CS_SUS_6; - } - SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioId, SUS::MAX_CMD_SIZE, + SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); @@ -125,11 +121,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); susHandlers[5]->setCustomFdir(fdir); - gpioId = gpioIds::CS_SUS_6; - if (swap0And6) { - gpioId = gpioIds::CS_SUS_0; - } - spiCookie = new SpiCookie(addresses::SUS_6, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, + spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8ed396c5..8a58eb90 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -486,9 +486,9 @@ void AcsController::copyMgmData() { } void AcsController::copySusData() { - ACS::SensorValues sensorValues; { PoolReadGuard pg(&sensorValues.susSets[0]); + if (pg.getReadResult() == returnvalue::OK) { std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, 6 * sizeof(uint16_t)); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index bc23fdaf..308700e4 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -60,6 +60,7 @@ class AcsController : public ExtendedControllerBase { void announceMode(bool recursive); /* ACS Datasets */ + ACS::SensorValues sensorValues; IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); // MGMs acsctrl::MgmDataRaw mgmDataRaw; diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index c814ca3a..134a86a7 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -1,6 +1,5 @@ #include - namespace satsystem { namespace acs {