Compare commits
16 Commits
e916b9b096
...
event-defi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a994be47c3 | ||
![]() |
893e0a41d7 | ||
b8979d8f90 | |||
9557db7036 | |||
c9fcabccd6 | |||
ecd36f5e52 | |||
fc19c0838e | |||
![]() |
8c3f366d1a | ||
![]() |
6efb2641a7 | ||
![]() |
260bbad9a0 | ||
9edd6221f8 | |||
735e341aab | |||
921bfb1e99 | |||
5b1651e1a6 | |||
![]() |
69c33587e8 | ||
![]() |
81cd8bd290 |
@@ -210,6 +210,7 @@ inline ReturnValue_t PoolVariable<T>::readWithoutLock() {
|
||||
}
|
||||
|
||||
this->value = *(poolEntry->getDataPtr());
|
||||
this->valid = poolEntry->getValid();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@@ -241,6 +242,7 @@ ReturnValue_t PoolVariable<T>::commitWithoutLock() {
|
||||
}
|
||||
|
||||
*(poolEntry->getDataPtr()) = this->value;
|
||||
poolEntry->setValid(this->valid);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
|
||||
|
||||
//! [EXPORT] : [COMMENT] Deletion of a TC from the map failed.
|
||||
//! P1: First 32 bit of request ID, P2. Last 32 bit of Request ID
|
||||
static constexpr Event TC_DELETION_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||
static constexpr Event TC_DELETION_FAILED = MAKE_EVENT(0, severity::MEDIUM);
|
||||
|
||||
// The types of PUS-11 subservices
|
||||
enum Subservice : uint8_t {
|
||||
|
@@ -53,17 +53,17 @@ void fsfwPrint(sif::PrintLevel printType, const char *fmt, va_list arg) {
|
||||
#endif
|
||||
|
||||
if (printType == sif::PrintLevel::INFO_LEVEL) {
|
||||
len += sprintf(bufferPosition + len, "INFO");
|
||||
len += sprintf(bufferPosition + len, "INFO ");
|
||||
}
|
||||
if (printType == sif::PrintLevel::DEBUG_LEVEL) {
|
||||
len += sprintf(bufferPosition + len, "DEBUG");
|
||||
len += sprintf(bufferPosition + len, "DEBUG ");
|
||||
}
|
||||
if (printType == sif::PrintLevel::WARNING_LEVEL) {
|
||||
len += sprintf(bufferPosition + len, "WARNING");
|
||||
}
|
||||
|
||||
if (printType == sif::PrintLevel::ERROR_LEVEL) {
|
||||
len += sprintf(bufferPosition + len, "ERROR");
|
||||
len += sprintf(bufferPosition + len, "ERROR ");
|
||||
}
|
||||
|
||||
#if FSFW_COLORED_OUTPUT == 1
|
||||
@@ -75,7 +75,7 @@ void fsfwPrint(sif::PrintLevel printType, const char *fmt, va_list arg) {
|
||||
/*
|
||||
* Log current time to terminal if desired.
|
||||
*/
|
||||
len += sprintf(bufferPosition + len, " | %lu:%02lu:%02lu.%03lu | ", (unsigned long)now.hour,
|
||||
len += sprintf(bufferPosition + len, " | %02lu:%02lu:%02lu.%03lu | ", (unsigned long)now.hour,
|
||||
(unsigned long)now.minute, (unsigned long)now.second,
|
||||
(unsigned long)now.usecond / 1000);
|
||||
|
||||
|
@@ -79,22 +79,36 @@ void SubsystemBase::executeTable(HybridIterator<ModeListEntry> tableIter, Submod
|
||||
}
|
||||
|
||||
if (healthHelper.healthTable->hasHealth(object)) {
|
||||
if (healthHelper.healthTable->isFaulty(object)) {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, HasModesIF::MODE_OFF,
|
||||
SUBMODE_NONE);
|
||||
} else {
|
||||
if (modeHelper.isForced()) {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED,
|
||||
tableIter.value->getMode(), submodeToCommand);
|
||||
} else {
|
||||
if (healthHelper.healthTable->isCommandable(object)) {
|
||||
|
||||
switch (healthHelper.healthTable->getHealth(object)) {
|
||||
case NEEDS_RECOVERY:
|
||||
case FAULTY:
|
||||
case PERMANENT_FAULTY:
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, HasModesIF::MODE_OFF,
|
||||
SUBMODE_NONE);
|
||||
break;
|
||||
case HEALTHY:
|
||||
if (modeHelper.isForced()) {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED,
|
||||
tableIter.value->getMode(), submodeToCommand);
|
||||
} else {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND,
|
||||
tableIter.value->getMode(), submodeToCommand);
|
||||
}
|
||||
break;
|
||||
case EXTERNAL_CONTROL:
|
||||
if (modeHelper.isForced()) {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED,
|
||||
tableIter.value->getMode(), submodeToCommand);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// This never happens
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND,
|
||||
tableIter.value->getMode(), submodeToCommand);
|
||||
|
@@ -25,7 +25,7 @@ static constexpr ReturnValue_t INCORRECT_SECONDARY_HEADER = MAKE_RETURN_CODE(11)
|
||||
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TMTC_DISTRIBUTION;
|
||||
//! P1: Returnvalue, P2: 0 for TM issues, 1 for TC issues
|
||||
static constexpr Event HANDLE_PACKET_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW);
|
||||
static constexpr Event HANDLE_PACKET_FAILED = MAKE_EVENT(0, severity::LOW);
|
||||
|
||||
}; // namespace tmtcdistrib
|
||||
#endif // FSFW_TMTCPACKET_DEFINITIONS_H
|
||||
|
@@ -142,7 +142,7 @@ class TemperatureSensor : public AbstractTemperatureSensor {
|
||||
|
||||
deltaTime = (uptime.tv_sec + uptime.tv_usec / 1000000.) -
|
||||
(uptimeOfOldTemperature.tv_sec + uptimeOfOldTemperature.tv_usec / 1000000.);
|
||||
deltaTemp = oldTemperature - outputTemperature;
|
||||
deltaTemp = oldTemperature - outputTemperature.value;
|
||||
if (deltaTemp < 0) {
|
||||
deltaTemp = -deltaTemp;
|
||||
}
|
||||
@@ -160,13 +160,13 @@ class TemperatureSensor : public AbstractTemperatureSensor {
|
||||
outputTemperature.setValid(PoolVariableIF::INVALID);
|
||||
outputTemperature = thermal::INVALID_TEMPERATURE;
|
||||
} else {
|
||||
oldTemperature = outputTemperature;
|
||||
oldTemperature = outputTemperature.value;
|
||||
uptimeOfOldTemperature = uptime;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
float getTemperature() { return outputTemperature; }
|
||||
float getTemperature() { return outputTemperature.value; }
|
||||
|
||||
bool isValid() { return outputTemperature.isValid(); }
|
||||
|
||||
|
Reference in New Issue
Block a user