From 3354f2a69649355e963a853f9233515a56e90c32 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Sep 2021 18:07:07 +0200 Subject: [PATCH] acd board tests continued --- .../fsfwconfig/devices/powerSwitcherList.h | 4 +- bsp_q7s/boardconfig/busConf.h | 3 +- bsp_q7s/core/InitMission.cpp | 4 +- bsp_q7s/core/ObjectFactory.cpp | 23 ++++--- bsp_q7s/core/ObjectFactory.h | 2 +- linux/boardtest/SpiTestClass.cpp | 68 +++++++++---------- linux/boardtest/SpiTestClass.h | 22 +++--- linux/fsfwconfig/devices/gpioIds.h | 3 + linux/fsfwconfig/devices/powerSwitcherList.h | 4 +- mission/devices/MGMHandlerRM3100.cpp | 30 ++++---- mission/devices/MGMHandlerRM3100.h | 7 +- mission/devices/PCDUHandler.cpp | 4 +- tmtc | 2 +- 13 files changed, 99 insertions(+), 77 deletions(-) diff --git a/bsp_hosted/fsfwconfig/devices/powerSwitcherList.h b/bsp_hosted/fsfwconfig/devices/powerSwitcherList.h index cacd23a1..c216c828 100644 --- a/bsp_hosted/fsfwconfig/devices/powerSwitcherList.h +++ b/bsp_hosted/fsfwconfig/devices/powerSwitcherList.h @@ -5,7 +5,7 @@ namespace pcduSwitches { /* Switches are uint8_t datatype and go from 0 to 255 */ - enum switcherList { + enum SwitcherList { Q7S, PAYLOAD_PCDU_CH1, RW, @@ -22,7 +22,7 @@ namespace pcduSwitches { SUS_NOMINAL, SOLAR_CELL_EXP, PLOC, - ACS_BORAD_SIDE_A, + ACS_BOARD_SIDE_A, NUMBER_OF_SWITCHES }; diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index ba4eda03..491930db 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -58,7 +58,7 @@ static constexpr uint32_t GPIO_RAD_SENSOR_CS = 19; // R18 /**************************************************************/ static constexpr char GPIO_FLEX_OBC1F_B1[] = "gpiochip6"; static const char* const GPIO_MGM2_LIS3_CHIP = GPIO_FLEX_OBC1F_B1; -static constexpr uint32_t GPIO_MGM_2_LIS3_CS = 0; +static constexpr uint32_t GPIO_MGM_2_LIS3_CS = 0; // D18 /**************************************************************/ /** OBC1C */ @@ -74,6 +74,7 @@ static constexpr uint32_t GPIO_HEATER_4_PIN = 3; static constexpr uint32_t GPIO_HEATER_5_PIN = 0; static constexpr uint32_t GPIO_HEATER_6_PIN = 1; static constexpr uint32_t GPIO_HEATER_7_PIN = 11; +static constexpr uint32_t GPIO_GYRO_2_ENABLE = 18; // F22 static constexpr uint32_t GPIO_SOL_DEPL_SA_0_PIN = 4; static constexpr uint32_t GPIO_SOL_DEPL_SA_1_PIN = 2; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 1b5f10fd..49e9d8ca 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -121,7 +121,7 @@ void initmission::initTasks() { std::vector pstTasks; createPstTasks(*factory, missedDeadlineFunc, pstTasks); -#if OBSW_ADD_TEST_TASK == 1 +#if OBSW_ADD_TEST_CODE == 1 std::vector testTasks; createTestTasks(*factory, missedDeadlineFunc, testTasks); #endif @@ -147,7 +147,7 @@ void initmission::initTasks() { taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); -#if OBSW_ADD_TEST_TASK == 1 +#if OBSW_ADD_TEST_CODE == 1 taskStarter(testTasks, "Test task vector"); #endif diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 8fcbfa52..e529fe09 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -97,6 +97,8 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; + //DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; + DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; // No storage object for now. TmFunnel::storageDestination = objects::NO_OBJECT; @@ -121,6 +123,7 @@ void ObjectFactory::produce(void* args){ createPcduComponents(); createRadSensorComponent(gpioComIF); createSunSensorComponents(gpioComIF, spiComIF); + #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF); #endif /* OBSW_ADD_ACS_BOARD == 1 */ @@ -183,7 +186,7 @@ void ObjectFactory::produce(void* args){ /* Test Task */ #if OBSW_ADD_TEST_CODE == 1 - createTestComponents(); + createTestComponents(gpioComIF); #endif /* OBSW_ADD_TEST_CODE == 1 */ new PlocUpdater(objects::PLOC_UPDATER); @@ -431,10 +434,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI "GNSS_1_NRESET", gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio); + // Enable pins must be pulled low for regular operations + gpio = new GpiodRegular(q7s::GPIO_FLEX_OBC1F_B0, q7s::GPIO_GYRO_0_ENABLE, + "GYRO_0_ENABLE", gpio::OUT, gpio::LOW); + gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio); + gpio = new GpiodRegular(q7s::GPIO_3V3_OBC1C, q7s::GPIO_GYRO_2_ENABLE, + "GYRO_2_ENABLE", gpio::OUT, gpio::LOW); + gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio); - - // GNSS enable pins must be pulled high - + // TODO: Add enable pins for GPS as soon as new interface board design is finished gpioComIF->addGpios(gpioCookieAcsBoard); std::string spiDev = q7s::SPI_DEFAULT_DEV; @@ -447,7 +455,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER, - objects::SPI_COM_IF, spiCookie); + objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_A); mgmRm3100Handler->setStartUpImmediately(); spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev, @@ -459,10 +467,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_3_RM3100_HANDLER, - objects::SPI_COM_IF, spiCookie); + objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_B); mgmRm3100Handler->setStartUpImmediately(); - // Commented until ACS board V2 in in clean room again // Gyro 0 Side A spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, @@ -806,7 +813,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { rw4SpiCookie->setCallbackArgs(rwHandler4); } -void ObjectFactory::createTestComponents() { +void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { #if BOARD_TE0720 == 0 new Q7STestTask(objects::TEST_TASK); diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 0e7ff9ff..ad9533a5 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -22,7 +22,7 @@ void createSolarArrayDeploymentComponents(); void createSyrlinksComponents(); void createRtdComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); -void createTestComponents(); +void createTestComponents(LinuxLibgpioIF* gpioComIF); }; diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 730a1743..ee08bc41 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -1,5 +1,4 @@ #include "SpiTestClass.h" -#include "OBSWConfig.h" #include "devices/gpioIds.h" @@ -20,7 +19,6 @@ #include #include - SpiTestClass::SpiTestClass(object_id_t objectId, GpioIF* gpioIF): TestTask(objectId), gpioIF(gpioIF) { if(gpioIF == nullptr) { @@ -37,11 +35,11 @@ ReturnValue_t SpiTestClass::performOneShotAction() { break; } case(TestModes::MGM_LIS3MDL): { - performLis3MdlTest(mgm2Lis3mdlChipSelect); + performLis3MdlTest(mgm0Lis3mdlChipSelect); break; } case(TestModes::MGM_RM3100): { - performRm3100Test(mgm3Rm3100ChipSelect); + performRm3100Test(mgm1Rm3100ChipSelect); break; } case(TestModes::GYRO_L3GD20H): { @@ -150,10 +148,10 @@ void SpiTestClass::performRm3100Test(uint8_t mgmId) { float fieldStrengthY = rawY * scaleFactor; float fieldStrengthZ = rawZ * scaleFactor; - sif::info << "RM3100 measured field strenghts in microtesla:" << std::endl; - sif::info << "Field Strength X: " << fieldStrengthX << " \xC2\xB5T" << std::endl; - sif::info << "Field Strength Y: " << fieldStrengthY << " \xC2\xB5T" << std::endl; - sif::info << "Field Strength Z: " << fieldStrengthZ << " \xC2\xB5T" << std::endl; + sif::info << "RM3100 measured field strengths in microtesla:" << std::endl; + sif::info << "Field Strength X: " << fieldStrengthX << " uT" << std::endl; + sif::info << "Field Strength Y: " << fieldStrengthY << " uT" << std::endl; + sif::info << "Field Strength Z: " << fieldStrengthZ << " uT" << std::endl; } void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) { @@ -174,8 +172,8 @@ void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) { else { currentGpioId = gpioIds::MGM_2_LIS3_CS; } - uint32_t spiSpeed = 3'900'000; - spi::SpiModes spiMode = spi::SpiModes::MODE_3; + uint32_t spiSpeed = 10'000'000; + spi::SpiModes spiMode = spi::SpiModes::MODE_0; #ifdef RASPBERRY_PI std::string deviceName = "/dev/spidev0.0"; #else @@ -208,10 +206,10 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) { /* Configure all SPI chip selects and pull them high */ acsInit(); - l3gId = gyro2L3gd20ChipSelect; + l3gId = gyro3L3gd20ChipSelect; /* Adapt accordingly */ - if(l3gId != gyro1L3gd20ChipSelect and l3gId != gyro2L3gd20ChipSelect) { + if(l3gId != gyro1L3gd20ChipSelect and l3gId != gyro3L3gd20ChipSelect) { sif::warning << "SpiTestClass::performLis3MdlTest: Invalid MGM ID!" << std::endl; } gpioId_t currentGpioId = 0; @@ -331,36 +329,32 @@ void SpiTestClass::acsInit() { gpio::Direction::OUT, 1); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); #elif defined(XIPHOS_Q7S) - std::string q7sGpioName5 = "gpiochip5"; - std::string q7sGpioName6 = "gpiochip6"; - gpio = new GpiodRegular(q7sGpioName5, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", - gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm0Lis3mdlChipSelect, + "MGM_0_LIS3", gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName5, mgm1Rm3100ChipSelect, "MGM_1_RM3100", - gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm1Rm3100ChipSelect, + "MGM_1_RM3100", gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName5, gyro0AdisChipSelect, "GYRO_0_ADIS", - gpio::Direction::OUT, gpio::HIGH); - gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName5, gyro1L3gd20ChipSelect, "GYRO_1_L3G", - gpio::Direction::OUT, gpio::HIGH); - gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName5, gyro2L3gd20ChipSelect, "GYRO_2_L3G", - gpio::Direction::OUT, gpio::HIGH); - gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName6, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", - gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegular(q7s::GPIO_MGM2_LIS3_CHIP, mgm2Lis3mdlChipSelect, + "MGM_2_LIS3", gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - - gpio = new GpiodRegular(q7sGpioName5, mgm3Rm3100ChipSelect, "MGM_3_RM3100", - gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm3Rm3100ChipSelect, + "MGM_3_RM3100", gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); + + gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, gyro0AdisChipSelect, + "GYRO_0_ADIS", gpio::Direction::OUT, gpio::HIGH); + gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); + gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, gyro1L3gd20ChipSelect, + "GYRO_1_L3G", gpio::Direction::OUT, gpio::HIGH); + gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); + gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, gyro2AdisChipSelect, + "GYRO_2_ADIS", gpio::Direction::OUT, gpio::HIGH); + gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); + gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, gyro3L3gd20ChipSelect, + "GYRO_3_L3G", gpio::Direction::OUT, gpio::HIGH); + gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); #endif if(gpioIF != nullptr) { gpioIF->addGpios(gpioCookie); diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index dd112a0e..d5309a1e 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -1,6 +1,12 @@ #ifndef LINUX_BOARDTEST_SPITESTCLASS_H_ #define LINUX_BOARDTEST_SPITESTCLASS_H_ +#include "OBSWConfig.h" + +#if defined(XIPHOS_Q7S) +#include "busConf.h" +#endif + #include #include #include @@ -47,14 +53,14 @@ private: uint8_t mgm2Lis3mdlChipSelect = 17; uint8_t mgm3Rm3100ChipSelect = 27; #elif defined(XIPHOS_Q7S) - uint8_t mgm0Lis3mdlChipSelect = 5; - uint8_t mgm1Rm3100ChipSelect = 17; - uint8_t gyro0AdisResetLine = 20; - uint8_t gyro0AdisChipSelect = 21; - uint8_t gyro1L3gd20ChipSelect = 10; - uint8_t gyro2L3gd20ChipSelect = 3; - uint8_t mgm2Lis3mdlChipSelect = 0; - uint8_t mgm3Rm3100ChipSelect = 23; + uint8_t mgm0Lis3mdlChipSelect = q7s::GPIO_MGM_0_LIS3_CS; + uint8_t mgm1Rm3100ChipSelect = q7s::GPIO_MGM_1_RM3100_CS; + uint8_t gyro0AdisChipSelect = q7s::GPIO_GYRO_0_ADIS_CS; + uint8_t gyro2AdisChipSelect = q7s::GPIO_GYRO_2_ADIS_CS; + uint8_t gyro1L3gd20ChipSelect = q7s::GPIO_GYRO_1_L3G_CS; + uint8_t gyro3L3gd20ChipSelect = q7s::GPIO_GYRO_3_L3G_CS; + uint8_t mgm2Lis3mdlChipSelect = q7s::GPIO_MGM_2_LIS3_CS; + uint8_t mgm3Rm3100ChipSelect = q7s::GPIO_MGM_3_RM3100_CS; #else uint8_t mgm0Lis3mdlChipSelect = 0; uint8_t mgm1Rm3100ChipSelect = 0; diff --git a/linux/fsfwconfig/devices/gpioIds.h b/linux/fsfwconfig/devices/gpioIds.h index e8709f2e..b450bf8b 100644 --- a/linux/fsfwconfig/devices/gpioIds.h +++ b/linux/fsfwconfig/devices/gpioIds.h @@ -28,6 +28,9 @@ enum gpioId_t { GNSS_0_NRESET, GNSS_1_NRESET, + GYRO_0_ENABLE, + GYRO_2_ENABLE, + TEST_ID_0, TEST_ID_1, diff --git a/linux/fsfwconfig/devices/powerSwitcherList.h b/linux/fsfwconfig/devices/powerSwitcherList.h index 9facfd80..bc5731fd 100644 --- a/linux/fsfwconfig/devices/powerSwitcherList.h +++ b/linux/fsfwconfig/devices/powerSwitcherList.h @@ -5,7 +5,7 @@ namespace pcduSwitches { /* Switches are uint8_t datatype and go from 0 to 255 */ - enum switcherList { + enum SwitcherList: uint8_t { Q7S, PAYLOAD_PCDU_CH1, RW, @@ -22,7 +22,7 @@ namespace pcduSwitches { SUS_NOMINAL, SOLAR_CELL_EXP, PLOC, - ACS_BORAD_SIDE_A, + ACS_BOARD_SIDE_A, NUMBER_OF_SWITCHES }; diff --git a/mission/devices/MGMHandlerRM3100.cpp b/mission/devices/MGMHandlerRM3100.cpp index 0f7fc729..a4878b95 100644 --- a/mission/devices/MGMHandlerRM3100.cpp +++ b/mission/devices/MGMHandlerRM3100.cpp @@ -8,9 +8,9 @@ MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId, - object_id_t deviceCommunication, CookieIF* comCookie): + object_id_t deviceCommunication, CookieIF* comCookie, uint8_t switchId): DeviceHandlerBase(objectId, deviceCommunication, comCookie), - primaryDataset(this) { + primaryDataset(this), switchId(switchId) { #if OBSW_VERBOSE_LEVEL >= 1 debugDivider = new PeriodicOperationDivider(5); #endif @@ -300,16 +300,16 @@ ReturnValue_t MGMHandlerRM3100::handleTmrcConfigCommand( } void MGMHandlerRM3100::fillCommandAndReplyMap() { - insertInCommandAndReplyMap(RM3100::CONFIGURE_CMM, 1); - insertInCommandAndReplyMap(RM3100::READ_CMM, 1); + insertInCommandAndReplyMap(RM3100::CONFIGURE_CMM, 3); + insertInCommandAndReplyMap(RM3100::READ_CMM, 3); - insertInCommandAndReplyMap(RM3100::CONFIGURE_TMRC, 1); - insertInCommandAndReplyMap(RM3100::READ_TMRC, 1); + insertInCommandAndReplyMap(RM3100::CONFIGURE_TMRC, 3); + insertInCommandAndReplyMap(RM3100::READ_TMRC, 3); - insertInCommandAndReplyMap(RM3100::CONFIGURE_CYCLE_COUNT, 1); - insertInCommandAndReplyMap(RM3100::READ_CYCLE_COUNT, 1); + insertInCommandAndReplyMap(RM3100::CONFIGURE_CYCLE_COUNT, 3); + insertInCommandAndReplyMap(RM3100::READ_CYCLE_COUNT, 3); - insertInCommandAndReplyMap(RM3100::READ_DATA, 1, &primaryDataset); + insertInCommandAndReplyMap(RM3100::READ_DATA, 3, &primaryDataset); } void MGMHandlerRM3100::modeChanged(void) { @@ -328,6 +328,12 @@ uint32_t MGMHandlerRM3100::getTransitionDelayMs(Mode_t from, Mode_t to) { return 10000; } +ReturnValue_t MGMHandlerRM3100::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) { + *switches = &switchId; + *numberOfSwitches = 1; + return HasReturnvaluesIF::RETURN_OK; +} + ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) { /* Analyze data here. The sensor generates 24 bit signed values so we need to do some bitshift * trickery here to calculate the raw values first */ @@ -345,9 +351,9 @@ ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) { sif::info << "MGMHandlerRM3100: Magnetic field strength in" " microtesla:" << std::endl; /* Set terminal to utf-8 if there is an issue with micro printout. */ - sif::info << "X: " << fieldStrengthX << " \xC2\xB5T" << std::endl; - sif::info << "Y: " << fieldStrengthY << " \xC2\xB5T" << std::endl; - sif::info << "Z: " << fieldStrengthZ << " \xC2\xB5T" << std::endl; + sif::info << "X: " << fieldStrengthX << " uT" << std::endl; + sif::info << "Y: " << fieldStrengthY << " uT" << std::endl; + sif::info << "Z: " << fieldStrengthZ << " uT" << std::endl; } #endif diff --git a/mission/devices/MGMHandlerRM3100.h b/mission/devices/MGMHandlerRM3100.h index 48173e65..a499c568 100644 --- a/mission/devices/MGMHandlerRM3100.h +++ b/mission/devices/MGMHandlerRM3100.h @@ -2,6 +2,7 @@ #define MISSION_DEVICES_MGMRM3100HANDLER_H_ #include "OBSWConfig.h" +#include "devices/powerSwitcherList.h" #include "devicedefinitions/MGMHandlerRM3100Definitions.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" @@ -31,7 +32,7 @@ public: SUBSYSTEM_ID::MGM_RM3100, 0x01, severity::INFO); MGMHandlerRM3100(object_id_t objectId, object_id_t deviceCommunication, - CookieIF* comCookie); + CookieIF* comCookie, uint8_t switchId); virtual ~MGMHandlerRM3100(); protected: @@ -50,6 +51,8 @@ protected: DeviceCommandId_t *foundId, size_t *foundLen) override; ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + ReturnValue_t getSwitches(const uint8_t **switches, + uint8_t *numberOfSwitches) override; void fillCommandAndReplyMap() override; void modeChanged(void) override; @@ -87,6 +90,8 @@ private: float scaleFactorY = 1 / RM3100::DEFAULT_GAIN; float scaleFactorZ = 1 / RM3100::DEFAULT_GAIN; + uint8_t switchId; + ReturnValue_t handleCycleCountConfigCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,size_t commandDataLen); ReturnValue_t handleCycleCommand(bool oneCycleValue, diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index ba0e8667..fe7294ea 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -93,7 +93,7 @@ void PCDUHandler::initializeSwitchStates() { switchStates[pcduSwitches::SUS_NOMINAL] = pcduSwitches::INIT_STATE_SUS_NOMINAL; switchStates[pcduSwitches::SOLAR_CELL_EXP] = pcduSwitches::INIT_STATE_SOLAR_CELL_EXP; switchStates[pcduSwitches::PLOC] = pcduSwitches::INIT_STATE_PLOC; - switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_A; + switchStates[pcduSwitches::ACS_BOARD_SIDE_A] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_A; } void PCDUHandler::readCommandQueue() { @@ -186,7 +186,7 @@ void PCDUHandler::updatePdu1SwitchStates() { switchStates[pcduSwitches::SUS_NOMINAL] = pdu1HkTableDataset.voltageOutSUSNominal.value; switchStates[pcduSwitches::SOLAR_CELL_EXP] = pdu1HkTableDataset.voltageOutSolarCellExp.value; switchStates[pcduSwitches::PLOC] = pdu1HkTableDataset.voltageOutPLOC.value; - switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value; + switchStates[pcduSwitches::ACS_BOARD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value; } else { sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl; diff --git a/tmtc b/tmtc index 90f85b7d..d9968031 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 90f85b7dae63e93a3c5686fab9dd0d4a8147e96b +Subproject commit d9968031d641249ca0ad62e7c1c19ed22390078c