More TMP1075 bugfixes #727

Merged
muellerr merged 4 commits from more-tmp-bugfixes into main 2023-07-07 10:53:10 +02:00
6 changed files with 11 additions and 28 deletions
Showing only changes of commit 6182218813 - Show all commits

View File

@ -172,10 +172,6 @@ void ObjectFactory::createTmpComponents(std::vector<std::pair<object_id_t, addre
new Tmp1075Handler(tmpDevsToAdd[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]); new Tmp1075Handler(tmpDevsToAdd[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]);
tmpDevHandler->setCustomFdir(new TmpDevFdir(tmpDevsToAdd[idx].first)); tmpDevHandler->setCustomFdir(new TmpDevFdir(tmpDevsToAdd[idx].first));
tmpDevHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); tmpDevHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM);
// TODO: Remove this after TCS subsystem was added
// These devices are connected to the 3V3 stack and should be powered permanently. Therefore,
// we set them to normal mode immediately here.
tmpDevHandler->setModeNormal();
} }
} }

View File

@ -7,15 +7,21 @@ using namespace returnvalue;
Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {} : DeviceHandlerBase(objectId, comif, comCookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {}
void Max31865Dummy::doStartUp() { setMode(MODE_ON); } void Max31865Dummy::doStartUp() { setMode(MODE_ON); }
void Max31865Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); } void Max31865Dummy::doShutDown() {
PoolReadGuard pg(&set);
set.setValidity(false, true);
setMode(MODE_OFF);
}
ReturnValue_t Max31865Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t Max31865Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
} }
ReturnValue_t Max31865Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return OK; } ReturnValue_t Max31865Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t Max31865Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, ReturnValue_t Max31865Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData, const uint8_t *commandData,
size_t commandDataLen) { size_t commandDataLen) {
return 0; return NOTHING_TO_SEND;
} }
ReturnValue_t Max31865Dummy::scanForReply(const uint8_t *start, size_t len, ReturnValue_t Max31865Dummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) { DeviceCommandId_t *foundId, size_t *foundLen) {

View File

@ -1209,9 +1209,6 @@ void ThermalController::ctrlIfBoard() {
sensors[2].first = deviceTemperatures.mgm2SideB.isValid(); sensors[2].first = deviceTemperatures.mgm2SideB.isValid();
sensors[2].second = deviceTemperatures.mgm2SideB.value; sensors[2].second = deviceTemperatures.mgm2SideB.value;
numSensors = 3; numSensors = 3;
if (not sensors[1].first) {
sif::debug << "TMP1075 IF Board not valid" << std::endl;
}
HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_1_PCDU_PDU, ifBoardLimits); HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_1_PCDU_PDU, ifBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
// TODO: special event overheating + could go back to safe mode // TODO: special event overheating + could go back to safe mode
@ -1259,12 +1256,6 @@ void ThermalController::ctrlObcIfBoard() {
sensors[1].second = sensorTemperatures.tmp1075Tcs0.value; sensors[1].second = sensorTemperatures.tmp1075Tcs0.value;
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid(); sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
if (not sensors[1].first) {
sif::debug << "TMP1075 TCS 0 not valid" << std::endl;
}
if (not sensors[2].first) {
sif::debug << "TMP1075 TCS 1 not valid" << std::endl;
}
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits); HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
@ -1373,12 +1364,6 @@ void ThermalController::ctrlPlPcduBoard() {
sensors[2].second = deviceTemperatures.adcPayloadPcdu.value; sensors[2].second = deviceTemperatures.adcPayloadPcdu.value;
sensors[3].first = sensorTemperatures.plpcduHeatspreader.isValid(); sensors[3].first = sensorTemperatures.plpcduHeatspreader.isValid();
sensors[3].second = sensorTemperatures.plpcduHeatspreader.value; sensors[3].second = sensorTemperatures.plpcduHeatspreader.value;
if (not sensors[0].first) {
sif::debug << "TMP1075 PL PCDU 0 not valid" << std::endl;
}
if (not sensors[1].first) {
sif::debug << "TMP1075 PL PCDU 1 not valid" << std::endl;
}
numSensors = 4; numSensors = 4;
HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits); HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);

View File

@ -108,7 +108,7 @@ void buildNormalSequence(Subsystem& ss, ModeListEntry& eh, bool commandPlPcdu1)
iht(objects::TMP1075_HANDLER_TCS_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_TCS_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
iht(objects::TMP1075_HANDLER_PLPCDU_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_PLPCDU_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
if (commandPlPcdu1) { if (commandPlPcdu1) {
iht(objects::TMP1075_HANDLER_PLPCDU_1, NML, 0, TCS_TABLE_OFF_TRANS_0.second); iht(objects::TMP1075_HANDLER_PLPCDU_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
} }
iht(objects::TMP1075_HANDLER_IF_BOARD, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_IF_BOARD, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TRANS_0.first, &TCS_TABLE_NORMAL_TRANS_0.second)), check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TRANS_0.first, &TCS_TABLE_NORMAL_TRANS_0.second)),

View File

@ -134,15 +134,13 @@ ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &local
return returnvalue::OK; return returnvalue::OK;
} }
void Tmp1075Handler::setModeNormal() { setMode(_MODE_TO_NORMAL); }
ReturnValue_t Tmp1075Handler::setHealth(HealthState health) { ReturnValue_t Tmp1075Handler::setHealth(HealthState health) {
if (health != FAULTY and health != PERMANENT_FAULTY and health != HEALTHY and if (health != FAULTY and health != PERMANENT_FAULTY and health != HEALTHY and
health != EXTERNAL_CONTROL) { health != EXTERNAL_CONTROL) {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
// Required because we do not have an assembly. // Required because we do not have an assembly.
if (health == FAULTY) { if (health == FAULTY or health == PERMANENT_FAULTY) {
setMode(_MODE_SHUT_DOWN); setMode(_MODE_SHUT_DOWN);
} }
return DeviceHandlerBase::setHealth(health); return DeviceHandlerBase::setHealth(health);

View File

@ -20,8 +20,6 @@ class Tmp1075Handler : public DeviceHandlerBase {
Tmp1075Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie); Tmp1075Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie);
virtual ~Tmp1075Handler(); virtual ~Tmp1075Handler();
void setModeNormal();
protected: protected:
void doStartUp() override; void doStartUp() override;
void doShutDown() override; void doShutDown() override;