ACS and TCS board working together now
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -7,10 +7,10 @@
|
||||
|
||||
Max31865PT1000Handler::Max31865PT1000Handler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF *comCookie):
|
||||
DeviceHandlerBase(objectId, comIF, comCookie), sensorDataset(this),
|
||||
sensorDatasetSid(sensorDataset.getSid()) {
|
||||
DeviceHandlerBase(objectId, comIF, comCookie),
|
||||
sensorDataset(this), sensorDatasetSid(sensorDataset.getSid()) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
debugDivider = new PeriodicOperationDivider(0);
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -68,12 +68,21 @@ void Max31865PT1000Handler::doStartUp() {
|
||||
|
||||
if(internalState == InternalState::REQUEST_LOW_THRESHOLD) {
|
||||
if(commandExecuted) {
|
||||
setMode(MODE_ON);
|
||||
setMode(MODE_NORMAL);
|
||||
internalState = InternalState::RUNNING;
|
||||
internalState = InternalState::CLEAR_FAULT_BYTE;
|
||||
commandExecuted = false;
|
||||
}
|
||||
}
|
||||
if(internalState == InternalState::CLEAR_FAULT_BYTE) {
|
||||
if(commandExecuted) {
|
||||
commandExecuted = false;
|
||||
internalState = InternalState::RUNNING;
|
||||
if(instantNormal) {
|
||||
setMode(MODE_NORMAL);
|
||||
} else {
|
||||
setMode(_MODE_TO_ON);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Max31865PT1000Handler::doShutDown() {
|
||||
@ -132,6 +141,10 @@ ReturnValue_t Max31865PT1000Handler::buildTransitionDeviceCommand(
|
||||
*id = Max31865Definitions::REQUEST_LOW_THRESHOLD;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case(InternalState::CLEAR_FAULT_BYTE): {
|
||||
*id = Max31865Definitions::CLEAR_FAULT_BYTE;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
|
||||
default:
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
@ -305,7 +318,11 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start,
|
||||
else if(internalState == InternalState::CLEAR_FAULT_BYTE) {
|
||||
*foundId = Max31865Definitions::CLEAR_FAULT_BYTE;
|
||||
*foundLen = 2;
|
||||
internalState = InternalState::RUNNING;
|
||||
if(mode == _MODE_START_UP) {
|
||||
commandExecuted = true;
|
||||
} else {
|
||||
internalState = InternalState::RUNNING;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*foundId = Max31865Definitions::REQUEST_CONFIG;
|
||||
@ -323,10 +340,11 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(
|
||||
if(packet[1] != DEFAULT_CONFIG) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
// it propably would be better if we at least try one restart..
|
||||
sif::error << "Max31865PT1000Handler: Object ID: " << std::hex << this->getObjectId()
|
||||
<< ": Invalid configuration reply!" << std::endl;
|
||||
sif::error << "Max31865PT1000Handler: 0x" << std::hex << this->getObjectId()
|
||||
<< ": Invalid configuration reply" << std::endl;
|
||||
#else
|
||||
sif::printError("Max31865PT1000Handler: Invalid configuration reply!\n");
|
||||
sif::printError("Max31865PT1000Handler: %04x: Invalid configuration reply!\n",
|
||||
this->getObjectId());
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
@ -517,6 +535,12 @@ ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void Max31865PT1000Handler::modeChanged() {
|
||||
internalState = InternalState::NONE;
|
||||
void Max31865PT1000Handler::setInstantNormal(bool instantNormal) {
|
||||
this->instantNormal = instantNormal;
|
||||
}
|
||||
|
||||
void Max31865PT1000Handler::modeChanged() {
|
||||
if(mode == MODE_OFF) {
|
||||
internalState = InternalState::NONE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user