rtd dataset
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2022-05-31 16:44:57 +02:00
parent 0e6d2354fc
commit 593cc68b84
5 changed files with 32 additions and 11 deletions

View File

@ -1,5 +1,7 @@
#include "Max31865EiveHandler.h"
#include <fsfw/datapool/PoolReadGuard.h>
Max31865EiveHandler::Max31865EiveHandler(object_id_t objectId, object_id_t comIF,
CookieIF* comCookie)
: DeviceHandlerBase(objectId, comIF, comCookie, nullptr),
@ -154,6 +156,15 @@ ReturnValue_t Max31865EiveHandler::interpretDeviceReply(DeviceCommandId_t id,
// calculate approximation
float approxTemp = exchangeStruct.adcCode / 32.0 - 256.0;
PoolReadGuard pg(&sensorDataset);
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Max31865EiveHandler: Failed to read sensor dataset" << std::endl;
sensorDataset.temperatureCelcius.setValid(false);
return RETURN_OK;
}
sensorDataset.temperatureCelcius = approxTemp;
sensorDataset.temperatureCelcius.setValid(true);
if (debugMode) {
if (debugDivider.checkAndIncrement()) {
sif::info << "Max31865: " << std::setw(20) << std::left << locString << std::right