RTD Fix #345

Merged
muellerr merged 10 commits from meier/rtd-fix into develop 2023-01-20 12:27:18 +01:00
2 changed files with 11 additions and 6 deletions
Showing only changes of commit cc6c25cba6 - Show all commits

View File

@ -143,7 +143,7 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() {
auto result = returnvalue::OK; auto result = returnvalue::OK;
MutexGuard mg(readerMutex); MutexGuard mg(readerMutex);
if (mg.getLockResult() != returnvalue::OK) { if (mg.getLockResult() != returnvalue::OK) {
sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl; sif::warning << "Max31865RtdReader::periodicReadHandling: Mutex lock failed" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
// Now read the RTD values // Now read the RTD values
@ -282,7 +282,13 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se
} }
break; break;
} }
case (EiveMax31855::RtdCommands::CFG): case (EiveMax31855::RtdCommands::CFG): {
ReturnValue_t result = writeCfgReg(rtdCookie->spiCookie, BASE_CFG);
if (result != returnvalue::OK) {
handleSpiError(rtdCookie, result, "writeCfgReg");
}
break;
}
default: { default: {
// TODO: Only implement if needed // TODO: Only implement if needed
break; break;

View File

@ -69,7 +69,8 @@ ReturnValue_t Max31865EiveHandler::buildCommandFromCommand(DeviceCommandId_t dev
switch (cmdTyped) { switch (cmdTyped) {
case (EiveMax31855::RtdCommands::ON): case (EiveMax31855::RtdCommands::ON):
case (EiveMax31855::RtdCommands::ACTIVE): case (EiveMax31855::RtdCommands::ACTIVE):
case (EiveMax31855::RtdCommands::OFF): { case (EiveMax31855::RtdCommands::OFF):
case (EiveMax31855::RtdCommands::CFG): {
simpleCommand(cmdTyped); simpleCommand(cmdTyped);
break; break;
} }
@ -77,9 +78,6 @@ ReturnValue_t Max31865EiveHandler::buildCommandFromCommand(DeviceCommandId_t dev
case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): { case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): {
break; break;
} }
case (EiveMax31855::RtdCommands::CFG): {
break;
}
default: default:
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
} }
@ -118,6 +116,7 @@ void Max31865EiveHandler::fillCommandAndReplyMap() {
insertInCommandMap(EiveMax31855::RtdCommands::ON); insertInCommandMap(EiveMax31855::RtdCommands::ON);
insertInCommandMap(EiveMax31855::RtdCommands::ACTIVE); insertInCommandMap(EiveMax31855::RtdCommands::ACTIVE);
insertInCommandMap(EiveMax31855::RtdCommands::OFF); insertInCommandMap(EiveMax31855::RtdCommands::OFF);
insertInCommandMap(EiveMax31855::RtdCommands::CFG);
insertInReplyMap(EiveMax31855::RtdCommands::EXCHANGE_SET_ID, 200, &sensorDataset, 0, true); insertInReplyMap(EiveMax31855::RtdCommands::EXCHANGE_SET_ID, 200, &sensorDataset, 0, true);
} }