v1.16.0 #323

Merged
muellerr merged 223 commits from develop into main 2022-11-18 14:23:24 +01:00
4 changed files with 31 additions and 22 deletions
Showing only changes of commit f9dd77b8ec - Show all commits

View File

@ -114,9 +114,9 @@ void initmission::initTasks() {
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
PeriodicTaskIF* acsTask = factory->createPeriodicTask( PeriodicTaskIF* gpsTask = factory->createPeriodicTask(
"ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); "ACS_CTRL", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
result = acsTask->addComponent(objects::GPS_CONTROLLER); result = gpsTask->addComponent(objects::GPS_CONTROLLER);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
} }
@ -124,7 +124,7 @@ void initmission::initTasks() {
#endif /* OBSW_ADD_ACS_HANDLERS */ #endif /* OBSW_ADD_ACS_HANDLERS */
PeriodicTaskIF* sysTask = factory->createPeriodicTask( PeriodicTaskIF* sysTask = factory->createPeriodicTask(
"SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); "SYS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
result = sysTask->addComponent(objects::ACS_BOARD_ASS); result = sysTask->addComponent(objects::ACS_BOARD_ASS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
@ -139,6 +139,10 @@ void initmission::initTasks() {
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS);
} }
result = sysTask->addComponent(objects::ACS_SUBSYSTEM);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM);
}
// FS task, task interval does not matter because it runs in permanent loop, priority low // FS task, task interval does not matter because it runs in permanent loop, priority low
// because it is a non-essential background task // because it is a non-essential background task
@ -227,7 +231,7 @@ void initmission::initTasks() {
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
acsTask->startTask(); gpsTask->startTask();
#endif #endif
sysTask->startTask(); sysTask->startTask();

View File

@ -42,6 +42,7 @@
#include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/SusAssembly.h"
#include "mission/system/objects/SusFdir.h" #include "mission/system/objects/SusFdir.h"
#include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/objects/TcsBoardAssembly.h"
#include "mission/system/tree/acsModeTree.h"
#include "tmtc/apid.h" #include "tmtc/apid.h"
#include "tmtc/pusIds.h" #include "tmtc/pusIds.h"
@ -135,6 +136,7 @@ void ObjectFactory::produce(void* args) {
SpiComIF* spiComIF = nullptr; SpiComIF* spiComIF = nullptr;
I2cComIF* i2cComIF = nullptr; I2cComIF* i2cComIF = nullptr;
PowerSwitchIF* pwrSwitcher = nullptr; PowerSwitchIF* pwrSwitcher = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF); createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
createTmpComponents(); createTmpComponents();
new CoreController(objects::CORE_CONTROLLER); new CoreController(objects::CORE_CONTROLLER);
@ -205,6 +207,8 @@ void ObjectFactory::produce(void* args) {
new PlocUpdater(objects::PLOC_UPDATER); new PlocUpdater(objects::PLOC_UPDATER);
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
satsystem::initAcsSubsystem();
} }
void ObjectFactory::createTmpComponents() { void ObjectFactory::createTmpComponents() {

View File

@ -8,8 +8,16 @@
#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h"
void checkInsert(ReturnValue_t result, const char* ctx);
void buildOffSequence(Subsystem* ss, ModeListEntry& eh);
void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper);
// Alias for checker function // Alias for checker function
const auto CHK = satsystem::checkInsert; const auto CHK = checkInsert;
static const auto OFF = HasModesIF::MODE_OFF; static const auto OFF = HasModesIF::MODE_OFF;
static const auto NML = DeviceHandlerIF::MODE_NORMAL; static const auto NML = DeviceHandlerIF::MODE_NORMAL;
@ -65,7 +73,7 @@ auto ACS_TABLE_TARGET_PT_TRANS_0 =
auto ACS_TABLE_TARGET_PT_TRANS_1 = auto ACS_TABLE_TARGET_PT_TRANS_1 =
std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList<ModeListEntry, 1>()); std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList<ModeListEntry, 1>());
void satsystem::acsSubsystemInit() { void satsystem::initAcsSubsystem() {
ModeListEntry entry; ModeListEntry entry;
Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24);
buildOffSequence(acsSubsystem, entry); buildOffSequence(acsSubsystem, entry);
@ -77,7 +85,7 @@ void satsystem::acsSubsystemInit() {
acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF);
} }
void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildOffSequence"; std::string context = "satsystem::buildOffSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -116,7 +124,7 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
ctxc); ctxc);
} }
void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildSafeSequence"; std::string context = "satsystem::buildSafeSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -165,7 +173,7 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
ctxc); ctxc);
} }
void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildDetumbleSequence"; std::string context = "satsystem::buildDetumbleSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -217,7 +225,7 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
ctxc); ctxc);
} }
void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildIdleSequence"; std::string context = "satsystem::buildIdleSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -264,7 +272,7 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {
false, true); false, true);
} }
void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildIdleChargeSequence"; std::string context = "satsystem::buildIdleChargeSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -318,7 +326,7 @@ void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
ctxc); ctxc);
} }
void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
std::string context = "satsystem::buildTargetPtSequence"; std::string context = "satsystem::buildTargetPtSequence";
auto ctxc = context.c_str(); auto ctxc = context.c_str();
// Insert Helper Table // Insert Helper Table
@ -373,7 +381,7 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
ctxc); ctxc);
} }
void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { void checkInsert(ReturnValue_t result, const char* ctx) {
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl;
} }

View File

@ -4,13 +4,6 @@ class Subsystem;
namespace satsystem { namespace satsystem {
void acsSubsystemInit(); void initAcsSubsystem();
void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper);
void checkInsert(ReturnValue_t result, const char* ctx);
} // namespace satsystem } // namespace satsystem