v1.12.0 #269

Merged
muellerr merged 493 commits from develop into main 2022-07-04 11:19:05 +02:00
4 changed files with 38 additions and 20 deletions
Showing only changes of commit be1c26ddf7 - Show all commits

View File

@ -297,6 +297,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]);
rtds[idx] = typedHandler; rtds[idx] = typedHandler;
typedHandler->setDeviceInfo(idx + 3, rtdInfos[idx].second); typedHandler->setDeviceInfo(idx + 3, rtdInfos[idx].second);
#if OBSW_DEBUG_RTD == 1
typedHandler->setDebugMode(true);
#endif
#if OBSW_TEST_RTD == 1
typedHandler->setInstantNormal(true);
#endif
}; };
auto lowLevelRtdsCreator = [&](uint8_t idx) { auto lowLevelRtdsCreator = [&](uint8_t idx) {
Max31865ReaderCookie* rtdLowLevelCookie = Max31865ReaderCookie* rtdLowLevelCookie =
@ -305,6 +311,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie);
rtds[idx] = typedHandler; rtds[idx] = typedHandler;
typedHandler->setDeviceInfo(idx, rtdInfos[idx].second); typedHandler->setDeviceInfo(idx, rtdInfos[idx].second);
#if OBSW_DEBUG_RTD == 1
// typedHandler->setDebugMode(true);
#endif
#if OBSW_TEST_RTD == 1
typedHandler->setInstantNormal(true);
#endif
}; };
for (uint8_t idx = 0; idx < NUM_RTDS; idx++) { for (uint8_t idx = 0; idx < NUM_RTDS; idx++) {
rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second,
@ -317,12 +329,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
rtds[idx]->setParent(objects::TCS_BOARD_ASS); rtds[idx]->setParent(objects::TCS_BOARD_ASS);
rtdFdir = new RtdFdir(rtdInfos[idx].first); rtdFdir = new RtdFdir(rtdInfos[idx].first);
rtds[idx]->setCustomFdir(rtdFdir); rtds[idx]->setCustomFdir(rtdFdir);
#if OBSW_DEBUG_RTD == 1
rtds[idx]->setDebugMode(true);
#endif
#if OBSW_TEST_RTD == 1 #if OBSW_TEST_RTD == 1
rtds[idx]->setStartUpImmediately(); rtds[idx]->setStartUpImmediately();
rtds[idx]->setInstantNormal(true);
#endif // OBSW_TEST_RTD == 1 #endif // OBSW_TEST_RTD == 1
} }

View File

@ -54,7 +54,8 @@ bool Max31865RtdReader::periodicInitHandling() {
if (rtd == nullptr) { if (rtd == nullptr) {
continue; continue;
} }
if (rtd->on and not rtd->configured) { if ((rtd->on or rtd->active) and not rtd->configured) {
sif::debug << "crap1" << std::endl;
if (rtd->cd.hasTimedOut()) { if (rtd->cd.hasTimedOut()) {
uint8_t cfg = uint8_t cfg =
(Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) | (Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) |
@ -117,7 +118,9 @@ void Max31865RtdReader::periodicReadReqHandling() {
if (rtd == nullptr) { if (rtd == nullptr) {
continue; continue;
} }
sif::debug << "crap2" << std::endl;
if (rtdIsActive(rtd->idx)) { if (rtdIsActive(rtd->idx)) {
sif::debug << "crap3" << std::endl;
uint8_t currentCfg = 0; uint8_t currentCfg = 0;
auto result = readCfgReg(rtd->spiCookie, currentCfg); auto result = readCfgReg(rtd->spiCookie, currentCfg);
if (result != RETURN_OK) { if (result != RETURN_OK) {
@ -151,6 +154,9 @@ void Max31865RtdReader::periodicReadHandling() {
handleSpiError(rtd, result, "readRtdVal"); handleSpiError(rtd, result, "readRtdVal");
continue; continue;
} }
if(rtd->idx == 0) {
sif::debug << "Read RAW rtd val 0: " << rtdVal << std::endl;
}
if (faultBitSet) { if (faultBitSet) {
rtd->db.faultBitSet = faultBitSet; rtd->db.faultBitSet = faultBitSet;
} }

View File

@ -103,7 +103,10 @@ void Max31865EiveHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
} }
void Max31865EiveHandler::fillCommandAndReplyMap() { void Max31865EiveHandler::fillCommandAndReplyMap() {
insertInReplyMap(EiveMax31855::RtdCommands::EXCHANGE_SET_ID, 2, &sensorDataset); insertInCommandMap(EiveMax31855::RtdCommands::ON);
insertInCommandMap(EiveMax31855::RtdCommands::ACTIVE);
insertInCommandMap(EiveMax31855::RtdCommands::OFF);
insertInReplyMap(EiveMax31855::RtdCommands::EXCHANGE_SET_ID, 2, &sensorDataset, 0, true);
} }
ReturnValue_t Max31865EiveHandler::scanForReply(const uint8_t* start, size_t remainingSize, ReturnValue_t Max31865EiveHandler::scanForReply(const uint8_t* start, size_t remainingSize,
@ -116,6 +119,7 @@ ReturnValue_t Max31865EiveHandler::scanForReply(const uint8_t* start, size_t rem
} }
*foundId = EiveMax31855::RtdCommands::EXCHANGE_SET_ID; *foundId = EiveMax31855::RtdCommands::EXCHANGE_SET_ID;
*foundLen = remainingSize; *foundLen = remainingSize;
sif::info << "Max31865EiveHandler::scanForReply: Reply size " << remainingSize << std::endl;
return RETURN_OK; return RETURN_OK;
} }

View File

@ -441,20 +441,20 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id,
} }
case (MAX31865::REQUEST_FAULT_BYTE): { case (MAX31865::REQUEST_FAULT_BYTE): {
faultByte = packet[1]; faultByte = packet[1];
#if OBSW_VERBOSE_LEVEL >= 1 //#if OBSW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1 //#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Max31865PT1000Handler::interpretDeviceReply: Object ID: " << std::hex // sif::warning << "Max31865PT1000Handler::interpretDeviceReply: Object ID: " << std::hex
<< this->getObjectId() // << this->getObjectId()
<< ": Fault byte" // << ": Fault byte"
" is: 0b" // " is: 0b"
<< std::bitset<8>(faultByte) << std::endl; // << std::bitset<8>(faultByte) << std::endl;
#else //#else
sif::printWarning( // sif::printWarning(
"Max31865PT1000Handler::interpretDeviceReply: Fault byte" // "Max31865PT1000Handler::interpretDeviceReply: Fault byte"
" is: 0b" BYTE_TO_BINARY_PATTERN "\n", // " is: 0b" BYTE_TO_BINARY_PATTERN "\n",
BYTE_TO_BINARY(faultByte)); // BYTE_TO_BINARY(faultByte));
#endif //#endif
#endif //#endif
ReturnValue_t result = sensorDataset.read(); ReturnValue_t result = sensorDataset.read();
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
// Configuration error // Configuration error