Merge remote-tracking branch 'origin/develop' into allow_switch_interval_specification
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-01-20 12:30:39 +01:00
commit 3d0ecadb1f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
4 changed files with 23 additions and 6 deletions

View File

@ -28,6 +28,9 @@ list yields a list of all related PRs for each release.
was adapted to burn each channel for half of the burn time by default. was adapted to burn each channel for half of the burn time by default.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/347 PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/347
TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/127 TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/127
- `Max31865RtdLowlevelHandler.cpp`: For each RTD device, the config is now re-written before
every read. This seems to fix some issue with invalid temperature sensor readings.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/345
## Fixed ## Fixed

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
@ -154,6 +154,10 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() {
if (rtdIsActive(rtd->idx)) { if (rtdIsActive(rtd->idx)) {
uint16_t rtdVal = 0; uint16_t rtdVal = 0;
bool faultBitSet = false; bool faultBitSet = false;
result = writeCfgReg(rtd->spiCookie, BASE_CFG);
if (result != returnvalue::OK) {
handleSpiError(rtd, result, "writeCfgReg");
}
result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet); result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
handleSpiError(rtd, result, "readRtdVal"); handleSpiError(rtd, result, "readRtdVal");
@ -282,7 +286,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

@ -9,8 +9,12 @@ PdecConfig::~PdecConfig() {}
void PdecConfig::initialize() { void PdecConfig::initialize() {
uint32_t word = 0; uint32_t word = 0;
word |= (VERSION_ID << 30); word |= (VERSION_ID << 30);
// Setting the bypass flag and the control command flag should not have any
// implication on the operation of the PDEC IP Core
word |= (BYPASS_FLAG << 29); word |= (BYPASS_FLAG << 29);
word |= (CONTROL_COMMAND_FLAG << 28); word |= (CONTROL_COMMAND_FLAG << 28);
word |= (RESERVED_FIELD_A << 26); word |= (RESERVED_FIELD_A << 26);
word |= (SPACECRAFT_ID << 16); word |= (SPACECRAFT_ID << 16);
word |= (VIRTUAL_CHANNEL << 10); word |= (VIRTUAL_CHANNEL << 10);

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;
} }
@ -100,6 +98,7 @@ void Max31865EiveHandler::simpleCommand(EiveMax31855::RtdCommands cmd) {
rawPacket = cmdBuf.data(); rawPacket = cmdBuf.data();
rawPacketLen = 1; rawPacketLen = 1;
} }
void Max31865EiveHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { void Max31865EiveHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
if (getMode() == _MODE_TO_NORMAL) { if (getMode() == _MODE_TO_NORMAL) {
if (state != InternalState::ACTIVE) { if (state != InternalState::ACTIVE) {
@ -117,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);
} }