start fixing this crap

This commit is contained in:
Robin Müller 2022-11-03 22:59:51 +01:00
parent ba70bde3e9
commit fe6b13bb81
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
7 changed files with 53 additions and 25 deletions

View File

@ -67,12 +67,6 @@ void initmission::initTasks() {
void (*missedDeadlineFunc)(void) = nullptr; void (*missedDeadlineFunc)(void) = nullptr;
#endif #endif
PeriodicTaskIF* sysCtrlTask = factory->createPeriodicTask(
"CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc);
result = sysCtrlTask->addComponent(objects::CORE_CONTROLLER);
if (result != returnvalue::OK) {
initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER);
}
#if OBSW_ADD_SA_DEPL == 1 #if OBSW_ADD_SA_DEPL == 1
// Could add this to the core controller but the core controller does so many thing that I would // Could add this to the core controller but the core controller does so many thing that I would
// prefer to have the solar array deployment in a seprate task. // prefer to have the solar array deployment in a seprate task.
@ -84,6 +78,17 @@ void initmission::initTasks() {
} }
#endif #endif
PeriodicTaskIF* sysTask = factory->createPeriodicTask(
"CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc);
result = sysTask->addComponent(objects::CORE_CONTROLLER);
if (result != returnvalue::OK) {
initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER);
}
result = sysTask->addComponent(objects::PL_SUBSYSTEM);
if (result != returnvalue::OK) {
initmission::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM);
}
/* TMTC Distribution */ /* TMTC Distribution */
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
"DIST", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); "DIST", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
@ -127,9 +132,7 @@ void initmission::initTasks() {
initmission::printAddObjectError("CCSDS Handler", objects::CCSDS_HANDLER); initmission::printAddObjectError("CCSDS Handler", objects::CCSDS_HANDLER);
} }
// Minimal distance between two received TCs amounts to 0.6 seconds // Runs in IRQ mode, frequency does not really matter
// If a command has not been read before the next one arrives, the old command will be
// overwritten by the PDEC.
PeriodicTaskIF* pdecHandlerTask = factory->createPeriodicTask( PeriodicTaskIF* pdecHandlerTask = factory->createPeriodicTask(
"PDEC_HANDLER", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); "PDEC_HANDLER", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
result = pdecHandlerTask->addComponent(objects::PDEC_HANDLER); result = pdecHandlerTask->addComponent(objects::PDEC_HANDLER);
@ -321,7 +324,7 @@ void initmission::initTasks() {
pdecHandlerTask->startTask(); pdecHandlerTask->startTask();
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
sysCtrlTask->startTask(); sysTask->startTask();
#if OBSW_ADD_SA_DEPL == 1 #if OBSW_ADD_SA_DEPL == 1
solarArrayDeplTask->startTask(); solarArrayDeplTask->startTask();
#endif #endif

View File

@ -127,11 +127,9 @@ enum commonObjects : uint32_t {
SUS_BOARD_ASS = 0x73000002, SUS_BOARD_ASS = 0x73000002,
TCS_BOARD_ASS = 0x73000003, TCS_BOARD_ASS = 0x73000003,
RW_ASS = 0x73000004, RW_ASS = 0x73000004,
PLOC_SWITCHER = 0x73000005,
CAM_SWITCHER = 0x73000006, CAM_SWITCHER = 0x73000006,
ACS_SUBSYSTEM = 0x73010001, ACS_SUBSYSTEM = 0x73010001,
PL_SUBSYSTEM = 0x73010002, PL_SUBSYSTEM = 0x73010002,
PLOC_SUBSYSTEM = 0x73010003,
EIVE_SYSTEM = 0x73010000, EIVE_SYSTEM = 0x73010000,
CFDP_HANDLER = 0x73000005, CFDP_HANDLER = 0x73000005,
CFDP_DISTRIBUTOR = 0x73000006, CFDP_DISTRIBUTOR = 0x73000006,

View File

@ -1,6 +1,7 @@
target_sources( target_sources(
${LIB_EIVE_MISSION} ${LIB_EIVE_MISSION}
PRIVATE EiveSystem.cpp PRIVATE EiveSystem.cpp
CamSwitcher.cpp
AcsSubsystem.cpp AcsSubsystem.cpp
ComSubsystem.cpp ComSubsystem.cpp
PayloadSubsystem.cpp PayloadSubsystem.cpp

View File

@ -0,0 +1,5 @@
#include "CamSwitcher.h"
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF *pwrSwitcher,
power::Switch_t pwrSwitch)
: PowerSwitcherComponent(objectId, pwrSwitcher, pwrSwitch) {}

View File

@ -0,0 +1,13 @@
#ifndef MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_
#define MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_
#include <fsfw/power/PowerSwitcherComponent.h>
class CamSwitcher : public PowerSwitcherComponent {
public:
CamSwitcher(object_id_t objectId, PowerSwitchIF *pwrSwitcher, power::Switch_t pwrSwitch);
private:
};
#endif /* MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_ */

View File

@ -27,7 +27,8 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
auto PL_SEQUENCE_OFF = std::make_pair(OFF << 24, FixedArrayList<ModeListEntry, 2>()); auto PL_SEQUENCE_OFF = std::make_pair(OFF << 24, FixedArrayList<ModeListEntry, 2>());
auto PL_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList<ModeListEntry, 0>()); auto PL_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList<ModeListEntry, 0>());
auto PL_TABLE_OFF_TRANS = std::make_pair((OFF << 24) | 2, FixedArrayList<ModeListEntry, 5>()); auto PL_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList<ModeListEntry, 5>());
auto PL_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList<ModeListEntry, 1>());
auto PL_SEQUENCE_MPSOC_STREAM = auto PL_SEQUENCE_MPSOC_STREAM =
std::make_pair(payload::Modes::MPSOC_STREAM << 24, FixedArrayList<ModeListEntry, 2>()); std::make_pair(payload::Modes::MPSOC_STREAM << 24, FixedArrayList<ModeListEntry, 2>());
@ -110,16 +111,21 @@ void initOffSequence(Subsystem* ss, ModeListEntry& eh) {
check(ss->addTable(TableEntry(PL_TABLE_OFF_TGT.first, &PL_TABLE_OFF_TGT.second)), ctxc); check(ss->addTable(TableEntry(PL_TABLE_OFF_TGT.first, &PL_TABLE_OFF_TGT.second)), ctxc);
// Build OFF transition 0 // Build OFF transition 0
iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS_0.second);
iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS_0.second);
iht(objects::SCEX, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::SCEX, OFF, 0, PL_TABLE_OFF_TRANS_0.second);
iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS_0.second);
iht(objects::PLOC_SUBSYSTEM, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::PLOC_MPSOC_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS_0.second);
check(ss->addTable(TableEntry(PL_TABLE_OFF_TRANS.first, &PL_TABLE_OFF_TRANS.second)), ctxc); check(ss->addTable(TableEntry(PL_TABLE_OFF_TRANS_0.first, &PL_TABLE_OFF_TRANS_0.second)), ctxc);
// Build OFF transition 1
iht(objects::PLOC_SUPERVISOR_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS_1.second);
check(ss->addTable(TableEntry(PL_TABLE_OFF_TRANS_1.first, &PL_TABLE_OFF_TRANS_1.second)), ctxc);
// Build OFF sequence // Build OFF sequence
ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TGT.first, 0, false); ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TGT.first, 0, false);
ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TRANS.first, 0, false); ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TRANS_0.first, 0, false);
ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TRANS_1.first, 0, false);
check(ss->addSequence( check(ss->addSequence(
SequenceEntry(PL_SEQUENCE_OFF.first, &PL_SEQUENCE_OFF.second, PL_SEQUENCE_OFF.first)), SequenceEntry(PL_SEQUENCE_OFF.first, &PL_SEQUENCE_OFF.second, PL_SEQUENCE_OFF.first)),
ctxc); ctxc);
@ -147,24 +153,26 @@ void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) {
// Build MPSoC stream target // Build MPSoC stream target
// Camera should always be off to prevent a conflict with the MPSoC streaming // Camera should always be off to prevent a conflict with the MPSoC streaming
// PL PCDU must be on and in normal mode, but this is commanded separately because of the
// number of commands invovled
iht(objects::PLPCDU_HANDLER, NML, plpcdu::ALL_ON_SUBMODE, PL_TABLE_MPSOC_STREAM_TGT.second); iht(objects::PLPCDU_HANDLER, NML, plpcdu::ALL_ON_SUBMODE, PL_TABLE_MPSOC_STREAM_TGT.second);
iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TGT.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TGT.second); iht(objects::PLOC_MPSOC_HANDLER, NML, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
iht(objects::PLOC_SUPERVISOR_HANDLER, NML, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
check( check(
ss->addTable(TableEntry(PL_TABLE_MPSOC_STREAM_TGT.first, &PL_TABLE_MPSOC_STREAM_TGT.second)), ss->addTable(TableEntry(PL_TABLE_MPSOC_STREAM_TGT.first, &PL_TABLE_MPSOC_STREAM_TGT.second)),
ctxc); ctxc);
// Build MPSoC stream transition 0 // Build MPSoC stream transition 0
iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second);
iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second);
iht(objects::SCEX, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::SCEX, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second);
iht(objects::PLOC_SUPERVISOR_HANDLER, NML, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
check(ss->addTable( check(ss->addTable(
TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_0.first, &PL_TABLE_MPSOC_STREAM_TRANS_0.second)), TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_0.first, &PL_TABLE_MPSOC_STREAM_TRANS_0.second)),
ctxc); ctxc);
// Build MPSoC stream transition 1 // Build MPSoC stream transition 1
iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TRANS_1.second); iht(objects::PLOC_MPSOC_HANDLER, NML, 0, PL_TABLE_MPSOC_STREAM_TGT.second);
check(ss->addTable( check(ss->addTable(
TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_1.first, &PL_TABLE_MPSOC_STREAM_TRANS_1.second)), TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_1.first, &PL_TABLE_MPSOC_STREAM_TRANS_1.second)),
ctxc); ctxc);

2
tmtc

@ -1 +1 @@
Subproject commit f62c67a11e54b99fdb60dab13e55456f16450951 Subproject commit f6fab2d44aff98174835c8446fd69c1ff589521b