From 481756b01430935b7b4ca422e6b9aff98b06fb7f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Dec 2021 11:49:50 +0100 Subject: [PATCH 1/4] fix script, experiment with timing --- cmake/scripts/Q7S/make-release-cfg.sh | 4 ++-- .../pollingsequence/pollingSequenceFactory.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/scripts/Q7S/make-release-cfg.sh b/cmake/scripts/Q7S/make-release-cfg.sh index d71dcc83..233bf263 100755 --- a/cmake/scripts/Q7S/make-release-cfg.sh +++ b/cmake/scripts/Q7S/make-release-cfg.sh @@ -17,7 +17,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" -build_dir="build-Debug-Q7S" +build_dir="build-Release-Q7S" build_generator="make" if [ "${OS}" = "Windows_NT" ]; then python="py" @@ -28,6 +28,6 @@ fi echo "Running command (without the leading +):" set -x # Print command -${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ +${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ -l"${build_dir}" # set +x diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 73a27116..c4ce9c25 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -59,9 +59,9 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_WRITE); #endif #if OBSW_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC_3, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC_4, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC_5, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_3, length * 0.15, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_4, length * 0.15, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_5, length * 0.15, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_6, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_7, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_8, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -439,8 +439,8 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_ACS_BOARD == 1 - bool enableAside = false; - bool enableBside = true; + bool enableAside = true; + bool enableBside = false; if(enableAside) { // A side thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, -- 2.43.0 From 64ab445f4ef9f04914ed4125f9992c45f1f74aee Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Dec 2021 11:55:47 +0100 Subject: [PATCH 2/4] initialize values --- bsp_q7s/core/CoreController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index d8149ccb..271ec508 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1094,8 +1094,8 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) { uint8_t wordIdx = 0; uint8_t arrayIdx = 0; istringstream iss(nextLine); - Chip currentChip; - Copy currentCopy; + Chip currentChip = Chip::CHIP_0; + Copy currentCopy = Copy::COPY_0; while(iss >> word) { if(wordIdx == 1) { currentChip = static_cast(stoi(word)); -- 2.43.0 From 50154c944a695f7e2da5dc605eae2417cb566d00 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Dec 2021 13:27:01 +0100 Subject: [PATCH 3/4] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 54e56ec5..e428568a 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 54e56ec522f485525de7b17458b22132003c5047 +Subproject commit e428568a00494c3e3ceb6d0b314baae97d4d8731 -- 2.43.0 From e442a8c968efb6d09fc759ef577618e2eeb4c11b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 17 Dec 2021 14:20:22 +0100 Subject: [PATCH 4/4] ACS and TCS board working together now --- bsp_q7s/boardconfig/busConf.h | 4 +- bsp_q7s/core/InitMission.cpp | 2 +- bsp_q7s/core/ObjectFactory.cpp | 37 +++++++------- common/config/devConf.h | 6 +-- fsfw | 2 +- linux/fsfwconfig/OBSWConfig.h.in | 1 - .../pollingSequenceFactory.cpp | 30 ++++++------ mission/devices/GyroADIS1650XHandler.cpp | 2 +- mission/devices/Max31865PT1000Handler.cpp | 48 ++++++++++++++----- mission/devices/Max31865PT1000Handler.h | 4 +- tmtc | 2 +- 11 files changed, 84 insertions(+), 54 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index af89d346..73605471 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -31,8 +31,8 @@ namespace gpioNames { static constexpr char MGM_3_CS[] = "mgm_3_rm3100_chip_select"; static constexpr char RESET_GNSS_0[] = "reset_gnss_0"; static constexpr char RESET_GNSS_1[] = "reset_gnss_1"; - static constexpr char GYRO_0_ENABLE[] = "gyro_0_enable"; - static constexpr char GYRO_2_ENABLE[] = "gyro_2_enable"; + static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0"; + static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2"; static constexpr char HEATER_0[] = "heater0"; static constexpr char HEATER_1[] = "heater1"; static constexpr char HEATER_2[] = "heater2"; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 81d972b1..80e95732 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -199,7 +199,7 @@ void initmission::createPstTasks(TaskFactory& factory, /* Polling Sequence Table Default */ #if OBSW_ADD_SPI_TEST_CODE == 0 FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( - "PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, + "PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); result = pst::pstSpi(spiPst); if (result != HasReturnvaluesIF::RETURN_OK) { diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3fb71db5..558f23b1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -698,45 +698,45 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF *gpioComIF) { gpioComIF->addGpios(rtdGpioCookie); SpiCookie* spiRtdIc0 = new SpiCookie(addresses::RTD_IC_3, gpioIds::RTD_IC_3, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc1 = new SpiCookie(addresses::RTD_IC_4, gpioIds::RTD_IC_4, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc2 = new SpiCookie(addresses::RTD_IC_5, gpioIds::RTD_IC_5, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc3 = new SpiCookie(addresses::RTD_IC_6, gpioIds::RTD_IC_6, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc4 = new SpiCookie(addresses::RTD_IC_7, gpioIds::RTD_IC_7, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc5 = new SpiCookie(addresses::RTD_IC_8, gpioIds::RTD_IC_8, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc6 = new SpiCookie(addresses::RTD_IC_9, gpioIds::RTD_IC_9, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, spi::RTD_SPEED); + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc7 = new SpiCookie(addresses::RTD_IC_10, gpioIds::RTD_IC_10, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc8 = new SpiCookie(addresses::RTD_IC_11, gpioIds::RTD_IC_11, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc9 = new SpiCookie(addresses::RTD_IC_12, gpioIds::RTD_IC_12, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc10 = new SpiCookie(addresses::RTD_IC_13, gpioIds::RTD_IC_13, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc11 = new SpiCookie(addresses::RTD_IC_14, gpioIds::RTD_IC_14, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc12 = new SpiCookie(addresses::RTD_IC_15, gpioIds::RTD_IC_15, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc13 = new SpiCookie(addresses::RTD_IC_16, gpioIds::RTD_IC_16, std::string(q7s::SPI_DEFAULT_DEV), Max31865Definitions::MAX_REPLY_SIZE, - spi::SpiModes::MODE_1, spi::RTD_SPEED); + spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc14 = new SpiCookie(addresses::RTD_IC_17, gpioIds::RTD_IC_17, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); SpiCookie* spiRtdIc15 = new SpiCookie(addresses::RTD_IC_18, gpioIds::RTD_IC_18, - q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, + q7s::SPI_DEFAULT_DEV, Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); Max31865PT1000Handler* rtdIc0 = new Max31865PT1000Handler(objects::RTD_IC_3, objects::SPI_COM_IF, @@ -775,6 +775,11 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF *gpioComIF) { rtdIc0->setStartUpImmediately(); rtdIc1->setStartUpImmediately(); rtdIc2->setStartUpImmediately(); +#if OBSW_DEBUG_RTD == 1 + rtdIc0->setInstantNormal(true); + rtdIc1->setInstantNormal(true); + rtdIc2->setInstantNormal(true); +#endif static_cast(rtdIc0); static_cast(rtdIc1); diff --git a/common/config/devConf.h b/common/config/devConf.h index 3fbded81..78681ec7 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -12,15 +12,15 @@ namespace spi { // Default values, changing them is not supported for now static constexpr uint32_t DEFAULT_LIS3_SPEED = 976'000; -static constexpr uint32_t LIS3_TRANSITION_DELAY = 10000; +static constexpr uint32_t LIS3_TRANSITION_DELAY = 5000; static constexpr spi::SpiModes DEFAULT_LIS3_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t DEFAULT_RM3100_SPEED = 976'000; -static constexpr uint32_t RM3100_TRANSITION_DELAY = 10000; +static constexpr uint32_t RM3100_TRANSITION_DELAY = 5000; static constexpr spi::SpiModes DEFAULT_RM3100_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t DEFAULT_L3G_SPEED = 976'000; -static constexpr uint32_t L3G_TRANSITION_DELAY = 10000; +static constexpr uint32_t L3G_TRANSITION_DELAY = 5000; static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 3'900'000; diff --git a/fsfw b/fsfw index e428568a..e5b568bc 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e428568a00494c3e3ceb6d0b314baae97d4d8731 +Subproject commit e5b568bc2b0b819bfb5c9dc90026d534852df4ff diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index a95bbfd5..1f12b579 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -102,7 +102,6 @@ debugging. */ #define OBSW_DEBUG_ACU 0 #define OBSW_DEBUG_SYRLINKS 0 #define OBSW_DEBUG_IMQT 0 -#define OBSW_DEBUG_ADIS16507 0 #define OBSW_DEBUG_RAD_SENSOR 0 #define OBSW_DEBUG_SUS 0 #define OBSW_DEBUG_RTD 0 diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index c4ce9c25..19d9b2de 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -59,9 +59,9 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_WRITE); #endif #if OBSW_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC_3, length * 0.15, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC_4, length * 0.15, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC_5, length * 0.15, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_3, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_4, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC_5, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_6, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_7, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::RTD_IC_8, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -415,27 +415,27 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #if OBSW_ADD_RW == 1 thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RW1, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW1, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW1, length * 0.65, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RW2, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0.85, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RW3, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0.85, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RW4, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0.85, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ); #endif #if OBSW_ADD_ACS_BOARD == 1 @@ -445,7 +445,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { // A side thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index 6124fc10..4820eefc 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -319,7 +319,7 @@ ReturnValue_t GyroADIS1650XHandler::handleSensorData(const uint8_t *packet) { } uint32_t GyroADIS1650XHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { - return 5000; + return 10000; } void GyroADIS1650XHandler::prepareWriteCommand(uint8_t startReg, uint8_t valueOne, diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 4cdc75b3..750d56e5 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -7,10 +7,10 @@ Max31865PT1000Handler::Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie): - DeviceHandlerBase(objectId, comIF, comCookie), sensorDataset(this), - sensorDatasetSid(sensorDataset.getSid()) { + DeviceHandlerBase(objectId, comIF, comCookie), + sensorDataset(this), sensorDatasetSid(sensorDataset.getSid()) { #if OBSW_VERBOSE_LEVEL >= 1 - debugDivider = new PeriodicOperationDivider(0); + debugDivider = new PeriodicOperationDivider(10); #endif } @@ -68,12 +68,21 @@ void Max31865PT1000Handler::doStartUp() { if(internalState == InternalState::REQUEST_LOW_THRESHOLD) { if(commandExecuted) { - setMode(MODE_ON); - setMode(MODE_NORMAL); - internalState = InternalState::RUNNING; + internalState = InternalState::CLEAR_FAULT_BYTE; commandExecuted = false; } } + if(internalState == InternalState::CLEAR_FAULT_BYTE) { + if(commandExecuted) { + commandExecuted = false; + internalState = InternalState::RUNNING; + if(instantNormal) { + setMode(MODE_NORMAL); + } else { + setMode(_MODE_TO_ON); + } + } + } } void Max31865PT1000Handler::doShutDown() { @@ -132,6 +141,10 @@ ReturnValue_t Max31865PT1000Handler::buildTransitionDeviceCommand( *id = Max31865Definitions::REQUEST_LOW_THRESHOLD; return buildCommandFromCommand(*id, nullptr, 0); } + case(InternalState::CLEAR_FAULT_BYTE): { + *id = Max31865Definitions::CLEAR_FAULT_BYTE; + return buildCommandFromCommand(*id, nullptr, 0); + } default: #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -305,7 +318,11 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, else if(internalState == InternalState::CLEAR_FAULT_BYTE) { *foundId = Max31865Definitions::CLEAR_FAULT_BYTE; *foundLen = 2; - internalState = InternalState::RUNNING; + if(mode == _MODE_START_UP) { + commandExecuted = true; + } else { + internalState = InternalState::RUNNING; + } } else { *foundId = Max31865Definitions::REQUEST_CONFIG; @@ -323,10 +340,11 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply( if(packet[1] != DEFAULT_CONFIG) { #if FSFW_CPP_OSTREAM_ENABLED == 1 // it propably would be better if we at least try one restart.. - sif::error << "Max31865PT1000Handler: Object ID: " << std::hex << this->getObjectId() - << ": Invalid configuration reply!" << std::endl; + sif::error << "Max31865PT1000Handler: 0x" << std::hex << this->getObjectId() + << ": Invalid configuration reply" << std::endl; #else - sif::printError("Max31865PT1000Handler: Invalid configuration reply!\n"); + sif::printError("Max31865PT1000Handler: %04x: Invalid configuration reply!\n", + this->getObjectId()); #endif return HasReturnvaluesIF::RETURN_OK; } @@ -517,6 +535,12 @@ ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool return HasReturnvaluesIF::RETURN_OK; } -void Max31865PT1000Handler::modeChanged() { - internalState = InternalState::NONE; +void Max31865PT1000Handler::setInstantNormal(bool instantNormal) { + this->instantNormal = instantNormal; +} + +void Max31865PT1000Handler::modeChanged() { + if(mode == MODE_OFF) { + internalState = InternalState::NONE; + } } diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 60fd2904..3be16150 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -45,6 +45,7 @@ public: // 8. 1 for 50 Hz filter, 0 for 60 Hz filter (noise rejection filter) static constexpr uint8_t DEFAULT_CONFIG = 0b11000001; + void setInstantNormal(bool instantNormal); /** * Expected temperature range is -100 C and 100 C. * If there are temperatures beyond this range there must be a fault. @@ -59,7 +60,7 @@ public: static constexpr float RTD_RREF_PT1000 = 4020.0; //!< Ohm static constexpr float RTD_RESISTANCE0_PT1000 = 1000.0; //!< Ohm protected: - /* DeviceHandlerBase abstract function implementation */ + // DeviceHandlerBase abstract function implementation void doStartUp() override; void doShutDown() override; ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; @@ -85,6 +86,7 @@ protected: private: uint8_t switchId = 0; + bool instantNormal = true; enum class InternalState { NONE, diff --git a/tmtc b/tmtc index eca5bba1..8cfc2892 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit eca5bba1d8df6576a19547d356e676b0fb164d87 +Subproject commit 8cfc2892dd95f959edb4b0ec1bbc8fc4aaa69ef2 -- 2.43.0