From b3bb76c75f8b692ff82775c56dd672e7a392ae11 Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Fri, 3 Jun 2022 18:03:25 +0200 Subject: [PATCH 1/2] bugfixes in hk handling --- linux/devices/ploc/PlocSupervisorHandler.cpp | 6 +++++- linux/devices/ploc/PlocSupervisorHandler.h | 2 ++ mission/devices/GomspaceDeviceHandler.cpp | 2 +- mission/devices/IMTQHandler.cpp | 2 ++ mission/devices/P60DockHandler.cpp | 8 ++++---- mission/devices/SusHandler.cpp | 4 +++- mission/devices/SyrlinksHkHandler.cpp | 2 +- tmtc | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index f7a83528..3338b9e8 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -142,7 +142,8 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId, } void PlocSupervisorHandler::doStartUp() { - switch (startupState) { +if (setTimeDuringStartup) { + switch (startupState) { case StartupState::OFF: { bootTimeout.resetTimer(); startupState = StartupState::BOOTING; @@ -163,6 +164,9 @@ void PlocSupervisorHandler::doStartUp() { default: break; } +} else { + setMode(_MODE_TO_ON); +} } void PlocSupervisorHandler::doShutDown() { diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 963591ab..f46b1ea7 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -95,6 +95,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { static const uint32_t BOOT_TIMEOUT = 2000; enum class StartupState : uint8_t { OFF, BOOTING, SET_TIME, SET_TIME_EXECUTING, ON }; + bool setTimeDuringStartup = false; + StartupState startupState = StartupState::OFF; uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]; diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index b3c939c3..275a9678 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -472,7 +472,7 @@ ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU dataOffset += 4; auxHk.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - coreHk.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1) / 10; + coreHk.temperature = (*(packet + dataOffset) << 8 | *(packet + dataOffset + 1)) * 0.1; dataOffset += 4; for (uint8_t idx = 0; idx < 3; idx++) { diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 049d5b15..2c9f5956 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -690,6 +690,8 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) { offset += 2; engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); + engHkDataset.setValidity(true, true); + if (debugMode) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl; diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 074cf3ad..646604da 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -180,8 +180,8 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60_OUTPUT_ENABLE, &outputEnables); - localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_BOOT_CAUSE, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_BOOT_CNT, new PoolEntry({0})); @@ -198,8 +198,8 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_BATTERY_CURRENT, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_BATTERY_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); localDataPoolMap.emplace(pool::DEVICES_TYPE, &devicesType); localDataPoolMap.emplace(pool::DEVICES_STATUS, &devicesStatus); diff --git a/mission/devices/SusHandler.cpp b/mission/devices/SusHandler.cpp index d763b47d..3cc10339 100644 --- a/mission/devices/SusHandler.cpp +++ b/mission/devices/SusHandler.cpp @@ -160,11 +160,11 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 } case SUS::READ_INT_TIMED_CONVERSIONS: { PoolReadGuard readSet(&dataset); - dataset.temperatureCelcius = max1227::getTemperature(((packet[0] & 0x0f) << 8) | packet[1]); for (uint8_t idx = 0; idx < 6; idx++) { dataset.channels[idx] = packet[idx * 2 + 2] << 8 | packet[idx * 2 + 3]; } + dataset.setValidity(true, true); printDataset(); break; } @@ -173,6 +173,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 for (uint8_t idx = 0; idx < 6; idx++) { dataset.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2]; } + dataset.channels.setValid(true); // Read temperature in next read cycle if (clkMode == ClkModes::EXT_CLOCKED_WITH_TEMP) { comState = ComStates::EXT_CLOCKED_TEMP; @@ -183,6 +184,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 case (SUS::READ_EXT_TIMED_TEMPS): { PoolReadGuard readSet(&dataset); dataset.temperatureCelcius = max1227::getTemperature(((packet[23] & 0x0f) << 8) | packet[24]); + dataset.temperatureCelcius.setValid(true); comState = ComStates::EXT_CLOCKED_CONVERSIONS; break; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 5ddeffbc..f9369cf2 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -361,8 +361,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - temperatureSet.temperatureBasebandBoard = tempBasebandBoard; PoolReadGuard rg(&temperatureSet); + temperatureSet.temperatureBasebandBoard = tempBasebandBoard; if (debugMode) { sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" << std::endl; diff --git a/tmtc b/tmtc index e2de2e02..ae021706 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e2de2e0212d5af87b111e6176f3b9f20b56081df +Subproject commit ae0217066b0b4b21b45aa1b39b8f39254ffd926a From f72dfa255dbeaa17b162387f1508ad5f0ccdd25f Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Fri, 3 Jun 2022 18:05:54 +0200 Subject: [PATCH 2/2] submodule update --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 95a64e1d..cda81fc8 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 95a64e1da3bb6d334c58c9ba78747bcdaccd5a8b +Subproject commit cda81fc8415c3873c035aa7ebbfa3fe93d519f08 diff --git a/tmtc b/tmtc index ae021706..58ed46e1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ae0217066b0b4b21b45aa1b39b8f39254ffd926a +Subproject commit 58ed46e110db362ff50f2b44737c8a7dd7027971