COM compiles again
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-01-27 11:29:13 +01:00
parent 7182d9b8cc
commit c9f8d2e219
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 19 additions and 18 deletions

View File

@ -3,41 +3,42 @@
#include "eive/objects.h" #include "eive/objects.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h> #include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/modes/HasModesIF.h> #include <fsfw/modes/HasModesIF.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h> #include <fsfw/returnvalues/returnvalue.h>
#include <fsfw/subsystem/Subsystem.h> #include <fsfw/subsystem/Subsystem.h>
#include "util.h" #include "util.h"
const auto check = subsystem::checkInsert; const auto check = subsystem::checkInsert;
Subsystem satsystem::com::SUBSYSTEM = Subsystem(objects::COM_SUBSYSTEM, 12, 24);
static const auto OFF = HasModesIF::MODE_OFF; static const auto OFF = HasModesIF::MODE_OFF;
static const auto ON = HasModesIF::MODE_ON; static const auto ON = HasModesIF::MODE_ON;
static const auto NML = DeviceHandlerIF::MODE_NORMAL; static const auto NML = DeviceHandlerIF::MODE_NORMAL;
auto COM_SEQUENCE_TX_OFF = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>()); auto COM_SEQUENCE_TX_OFF = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>());
auto COM_TABLE_TX_OFF_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 0>()); auto COM_TABLE_TX_OFF_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 1>());
auto COM_TABLE_TX_OFF_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>()); auto COM_TABLE_TX_OFF_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>());
auto COM_SEQUENCE_TX_ON = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>()); auto COM_SEQUENCE_TX_ON = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>());
auto COM_TABLE_TX_ON_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 0>()); auto COM_TABLE_TX_ON_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 1>());
auto COM_TABLE_TX_ON_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>()); auto COM_TABLE_TX_ON_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>());
namespace { namespace {
void buildTxOffSequence(Subsystem* ss, ModeListEntry& eh); void buildTxOffSequence(Subsystem& ss, ModeListEntry& eh);
void buildTxOnSequence(Subsystem* ss, ModeListEntry& eh); void buildTxOnSequence(Subsystem& ss, ModeListEntry& eh);
} // namespace } // namespace
void satsystem::com::init() { void satsystem::com::init() {
ModeListEntry entry; ModeListEntry entry;
Subsystem* comSubsystem = new Subsystem(objects::COM_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildTxOffSequence(SUBSYSTEM, entry);
buildTxOffSequence(comSubsystem, entry); buildTxOnSequence(SUBSYSTEM, entry);
buildTxOnSequence(comSubsystem, entry); SUBSYSTEM.setInitialMode(NML, 0 /* TODO: Which submode? */);
comSubsystem->setInitialMode(NML, 0 /* TODO: Which submode? */);
} }
namespace { namespace {
void buildTxOffSequence(Subsystem* ss, ModeListEntry& eh) { void buildTxOffSequence(Subsystem& ss, ModeListEntry& eh) {
std::string context = "satsystem::com::buildTxOffSequence"; std::string context = "satsystem::com::buildTxOffSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -58,21 +59,21 @@ void buildTxOffSequence(Subsystem* ss, ModeListEntry& eh) {
// Build TX OFF table // Build TX OFF table
iht(objects::SYRLINKS_HK_HANDLER, NML, 0/* TODO */, COM_TABLE_TX_OFF_TGT.second); iht(objects::SYRLINKS_HK_HANDLER, NML, 0/* TODO */, COM_TABLE_TX_OFF_TGT.second);
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TGT.second)), ctxc); check(ss.addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TGT.second)), ctxc);
// Build TX OFF transition // Build TX OFF transition
iht(objects::SYRLINKS_HK_HANDLER, NML, 0/* TODO */, COM_TABLE_TX_OFF_TRANS.second); iht(objects::SYRLINKS_HK_HANDLER, NML, 0/* TODO */, COM_TABLE_TX_OFF_TRANS.second);
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TRANS.second)), ctxc); check(ss.addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TRANS.second)), ctxc);
// Build TX OFF sequence // Build TX OFF sequence
ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TGT.first, 0, false); ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TGT.first, 0, false);
ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TRANS.first, 0, false); ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TRANS.first, 0, false);
check(ss->addSequence(SequenceEntry(COM_TABLE_TX_OFF_TRANS.first, &COM_TABLE_TX_OFF_TRANS.second, check(ss.addSequence(SequenceEntry(COM_TABLE_TX_OFF_TRANS.first, &COM_TABLE_TX_OFF_TRANS.second,
COM_TABLE_TX_OFF_TRANS.first)), COM_TABLE_TX_OFF_TRANS.first)),
ctxc); ctxc);
} }
void buildTxOnSequence(Subsystem* ss, ModeListEntry& eh) { void buildTxOnSequence(Subsystem& ss, ModeListEntry& eh) {
std::string context = "satsystem::com::buildTxOnSequence"; std::string context = "satsystem::com::buildTxOnSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -93,16 +94,16 @@ void buildTxOnSequence(Subsystem* ss, ModeListEntry& eh) {
// Build TX ON table // Build TX ON table
iht(objects::SYRLINKS_HK_HANDLER, NML, /*TODO*/0, COM_TABLE_TX_ON_TGT.second); iht(objects::SYRLINKS_HK_HANDLER, NML, /*TODO*/0, COM_TABLE_TX_ON_TGT.second);
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TGT.second)), ctxc); check(ss.addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TGT.second)), ctxc);
// Build TX ON transition // Build TX ON transition
iht(objects::SYRLINKS_HK_HANDLER, NML, /*TODO*/0, COM_TABLE_TX_ON_TRANS.second); iht(objects::SYRLINKS_HK_HANDLER, NML, /*TODO*/0, COM_TABLE_TX_ON_TRANS.second);
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TRANS.second)), ctxc); check(ss.addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TRANS.second)), ctxc);
// Build TX ON sequence // Build TX ON sequence
ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TGT.first, 0, false); ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TGT.first, 0, false);
ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TRANS.first, 0, false); ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TRANS.first, 0, false);
check(ss->addSequence(SequenceEntry(COM_TABLE_TX_ON_TRANS.first, &COM_TABLE_TX_ON_TRANS.second, check(ss.addSequence(SequenceEntry(COM_TABLE_TX_ON_TRANS.first, &COM_TABLE_TX_ON_TRANS.second,
COM_TABLE_TX_ON_TRANS.first)), COM_TABLE_TX_ON_TRANS.first)),
ctxc); ctxc);
} }

2
tmtc

@ -1 +1 @@
Subproject commit df1bbe9dede97c8587578af3969eacda7facfd32 Subproject commit 8b6039e15d6e1653fd9128b7d2c7991e5bee9588