This commit is contained in:
@ -297,6 +297,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||
new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]);
|
||||
rtds[idx] = typedHandler;
|
||||
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) {
|
||||
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);
|
||||
rtds[idx] = typedHandler;
|
||||
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++) {
|
||||
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);
|
||||
rtdFdir = new RtdFdir(rtdInfos[idx].first);
|
||||
rtds[idx]->setCustomFdir(rtdFdir);
|
||||
#if OBSW_DEBUG_RTD == 1
|
||||
rtds[idx]->setDebugMode(true);
|
||||
#endif
|
||||
#if OBSW_TEST_RTD == 1
|
||||
rtds[idx]->setStartUpImmediately();
|
||||
rtds[idx]->setInstantNormal(true);
|
||||
#endif // OBSW_TEST_RTD == 1
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,8 @@ bool Max31865RtdReader::periodicInitHandling() {
|
||||
if (rtd == nullptr) {
|
||||
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()) {
|
||||
uint8_t cfg =
|
||||
(Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) |
|
||||
@ -117,7 +118,9 @@ void Max31865RtdReader::periodicReadReqHandling() {
|
||||
if (rtd == nullptr) {
|
||||
continue;
|
||||
}
|
||||
sif::debug << "crap2" << std::endl;
|
||||
if (rtdIsActive(rtd->idx)) {
|
||||
sif::debug << "crap3" << std::endl;
|
||||
uint8_t currentCfg = 0;
|
||||
auto result = readCfgReg(rtd->spiCookie, currentCfg);
|
||||
if (result != RETURN_OK) {
|
||||
@ -151,6 +154,9 @@ void Max31865RtdReader::periodicReadHandling() {
|
||||
handleSpiError(rtd, result, "readRtdVal");
|
||||
continue;
|
||||
}
|
||||
if(rtd->idx == 0) {
|
||||
sif::debug << "Read RAW rtd val 0: " << rtdVal << std::endl;
|
||||
}
|
||||
if (faultBitSet) {
|
||||
rtd->db.faultBitSet = faultBitSet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user