tmp is back in the house
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
31fdbac8c0
commit
d6dd943ebf
@ -151,23 +151,16 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
|
||||
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
||||
|
||||
void ObjectFactory::createTmpComponents() {
|
||||
std::vector<std::pair<object_id_t, address_t>> tmpDevIds = {{
|
||||
{objects::TMP1075_HANDLER_TCS_0, addresses::TMP1075_TCS_0},
|
||||
{objects::TMP1075_HANDLER_TCS_1, addresses::TMP1075_TCS_1},
|
||||
{objects::TMP1075_HANDLER_PLPCDU_0, addresses::TMP1075_PLPCDU_0},
|
||||
// damaged
|
||||
// {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
|
||||
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
|
||||
}};
|
||||
void ObjectFactory::createTmpComponents(
|
||||
std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd) {
|
||||
std::vector<I2cCookie*> tmpDevCookies;
|
||||
|
||||
for (size_t idx = 0; idx < tmpDevIds.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tmpDevsToAdd.size(); idx++) {
|
||||
tmpDevCookies.push_back(
|
||||
new I2cCookie(tmpDevIds[idx].second, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_PL_EIVE));
|
||||
new I2cCookie(tmpDevsToAdd[idx].second, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_PL_EIVE));
|
||||
auto* tmpDevHandler =
|
||||
new Tmp1075Handler(tmpDevIds[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]);
|
||||
tmpDevHandler->setCustomFdir(new TmpDevFdir(tmpDevIds[idx].first));
|
||||
new Tmp1075Handler(tmpDevsToAdd[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]);
|
||||
tmpDevHandler->setCustomFdir(new TmpDevFdir(tmpDevsToAdd[idx].first));
|
||||
tmpDevHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM);
|
||||
// TODO: Remove this after TCS subsystem was added
|
||||
// These devices are connected to the 3V3 stack and should be powered permanently. Therefore,
|
||||
|
@ -58,7 +58,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher
|
||||
bool enableHkSets);
|
||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler);
|
||||
void createTmpComponents();
|
||||
void createTmpComponents(std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd);
|
||||
void createRadSensorChipSelect(LinuxLibgpioIF* gpioIF);
|
||||
ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler);
|
||||
void createAcsBoardGpios(GpioCookie& cookie);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "mission/pollingSeqTables.h"
|
||||
#include "mission/scheduling.h"
|
||||
#include "mission/utility/InitMission.h"
|
||||
#include "q7sConfig.h"
|
||||
|
||||
/* This is configured for linux without CR */
|
||||
#ifdef PLATFORM_UNIX
|
||||
@ -527,7 +528,15 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction
|
||||
FixedTimeslotTaskIF* i2cPst =
|
||||
factory.createFixedTimeslotTask("I2C_PS_PST", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.6,
|
||||
missedDeadlineFunc, &RR_SCHEDULING);
|
||||
result = pst::pstI2cProcessingSystem(i2cPst);
|
||||
pst::TmpSchedConfig tmpSchedConf;
|
||||
#if OBSW_Q7S_EM == 1
|
||||
tmpSchedConf.scheduleTmpDev0 = false;
|
||||
tmpSchedConf.scheduleTmpDev1 = false;
|
||||
tmpSchedConf.schedulePlPcduDev0 = true;
|
||||
tmpSchedConf.schedulePlPcduDev1 = true;
|
||||
tmpSchedConf.scheduleIfBoardDev = true;
|
||||
#endif
|
||||
result = pst::pstProgammableLogicI2c(tmpSchedConf, i2cPst);
|
||||
if (result != returnvalue::OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
sif::warning << "scheduling::initTasks: I2C PST is empty" << std::endl;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "busConf.h"
|
||||
#include "common/config/devices/addresses.h"
|
||||
#include "devConf.h"
|
||||
#include "dummies/helperFactory.h"
|
||||
#include "eive/objects.h"
|
||||
@ -60,6 +61,14 @@ void ObjectFactory::produce(void* args) {
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1 || OBSW_ADD_PLOC_MPSOC == 1
|
||||
dummyCfg.addPlocDummies = false;
|
||||
#endif
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd = {{
|
||||
{objects::TMP1075_HANDLER_PLPCDU_0, addresses::TMP1075_PLPCDU_0},
|
||||
{objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
|
||||
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
|
||||
}};
|
||||
createTmpComponents(tmpDevsToAdd);
|
||||
#endif
|
||||
#if OBSW_ADD_GOMSPACE_PCDU == 1
|
||||
dummyCfg.addPowerDummies = false;
|
||||
// The ACU broke.
|
||||
|
@ -67,7 +67,15 @@ void ObjectFactory::produce(void* args) {
|
||||
HeaterHandler* heaterHandler;
|
||||
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler);
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
createTmpComponents();
|
||||
std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd = {{
|
||||
{objects::TMP1075_HANDLER_TCS_0, addresses::TMP1075_TCS_0},
|
||||
{objects::TMP1075_HANDLER_TCS_1, addresses::TMP1075_TCS_1},
|
||||
{objects::TMP1075_HANDLER_PLPCDU_0, addresses::TMP1075_PLPCDU_0},
|
||||
// damaged
|
||||
// {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
|
||||
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
|
||||
}};
|
||||
createTmpComponents(tmpDevsToAdd);
|
||||
#endif
|
||||
createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF);
|
||||
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler);
|
||||
|
@ -39,26 +39,33 @@ ReturnValue_t pst::pstSyrlinks(FixedTimeslotTaskIF *thisSequence) {
|
||||
|
||||
// I don't think this needs to be in a PST because linux takes care of bus serialization, but
|
||||
// keep it like this for now, it works
|
||||
ReturnValue_t pst::pstI2cProcessingSystem(FixedTimeslotTaskIF *thisSequence) {
|
||||
ReturnValue_t pst::pstProgammableLogicI2c(TmpSchedConfig schedConf,
|
||||
FixedTimeslotTaskIF *thisSequence) {
|
||||
// Length of a communication cycle
|
||||
uint32_t length = thisSequence->getPeriodMs();
|
||||
static_cast<void>(length);
|
||||
|
||||
// These are actually part of another bus, but this works, so keep it like this for now
|
||||
if (schedConf.scheduleTmpDev0) {
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.2,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.2,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.3, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.3, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (schedConf.scheduleTmpDev1) {
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (schedConf.schedulePlPcduDev0) {
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6,
|
||||
@ -67,9 +74,10 @@ ReturnValue_t pst::pstI2cProcessingSystem(FixedTimeslotTaskIF *thisSequence) {
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.7,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.7, DeviceHandlerIF::GET_READ);
|
||||
// damaged
|
||||
/*
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.7,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (schedConf.schedulePlPcduDev1) {
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4,
|
||||
@ -78,8 +86,11 @@ ReturnValue_t pst::pstI2cProcessingSystem(FixedTimeslotTaskIF *thisSequence) {
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
*/
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (schedConf.scheduleIfBoardDev) {
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8,
|
||||
@ -88,7 +99,9 @@ ReturnValue_t pst::pstI2cProcessingSystem(FixedTimeslotTaskIF *thisSequence) {
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.9,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.9, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.9,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
static_cast<void>(length);
|
||||
return thisSequence->checkSequence();
|
||||
}
|
||||
|
@ -39,6 +39,16 @@ struct AcsPstCfg {
|
||||
bool scheduleStr = true;
|
||||
};
|
||||
|
||||
// Default config is for FM.
|
||||
struct TmpSchedConfig {
|
||||
bool scheduleTmpDev0 = true;
|
||||
bool scheduleTmpDev1 = true;
|
||||
bool schedulePlPcduDev0 = true;
|
||||
// damaged on FM
|
||||
bool schedulePlPcduDev1 = false;
|
||||
bool scheduleIfBoardDev = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This function creates the PST for all gomspace devices.
|
||||
* @details
|
||||
@ -51,7 +61,7 @@ ReturnValue_t pstSyrlinks(FixedTimeslotTaskIF* thisSequence);
|
||||
|
||||
ReturnValue_t pstTcsAndAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg);
|
||||
|
||||
ReturnValue_t pstI2cProcessingSystem(FixedTimeslotTaskIF* thisSequence);
|
||||
ReturnValue_t pstProgammableLogicI2c(TmpSchedConfig schedConf, FixedTimeslotTaskIF* thisSequence);
|
||||
|
||||
/**
|
||||
* Generic test PST
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 936dcdf334c2258d2256373cd4995b2574202a59
|
||||
Subproject commit 970c8998f0bb719ab4b289fa95406d7037b2bb35
|
Loading…
Reference in New Issue
Block a user