From 28c9e33d1ca012553c3dc5efc000df197eb03dd3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 5 May 2022 02:00:56 +0200 Subject: [PATCH] separate PST for RWs --- bsp_q7s/core/InitMission.cpp | 23 ++++++-- cmake/scripts/q7s/q7s-make-release.sh | 2 +- fsfw | 2 +- .../pollingSequenceFactory.cpp | 55 ++++++++++--------- .../pollingsequence/pollingSequenceFactory.h | 2 + misc/eclipse/.cproject | 2 +- tmtc | 2 +- 7 files changed, 54 insertions(+), 34 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 6fd2d723..f2ff337a 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -241,7 +241,7 @@ void initmission::createPstTasks(TaskFactory& factory, /* Polling Sequence Table Default */ #if OBSW_ADD_SPI_TEST_CODE == 0 FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( - "PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); + "MAIN_SPI", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); result = pst::pstSpi(spiPst); if (result != HasReturnvaluesIF::RETURN_OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { @@ -254,8 +254,23 @@ void initmission::createPstTasks(TaskFactory& factory, } #endif +#if OBSW_ADD_RW == 1 + FixedTimeslotTaskIF* rwPstTask = factory.createFixedTimeslotTask( + "RW_SPI", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc); + result = pst::pstSpiRw(rwPstTask); + if (result != HasReturnvaluesIF::RETURN_OK) { + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl; + } else { + sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl; + } + } else { + taskVec.push_back(rwPstTask); + } +#endif + FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask( - "UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); + "UART_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstUart(uartPst); if (result != HasReturnvaluesIF::RETURN_OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { @@ -268,7 +283,7 @@ void initmission::createPstTasks(TaskFactory& factory, } FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask( - "GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); + "GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.2, missedDeadlineFunc); result = pst::pstGpio(gpioPst); if (result != HasReturnvaluesIF::RETURN_OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { @@ -281,7 +296,7 @@ void initmission::createPstTasks(TaskFactory& factory, } #if OBSW_ADD_I2C_TEST_CODE == 0 FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask( - "I2C_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); + "I2C_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstI2c(i2cPst); if (result != HasReturnvaluesIF::RETURN_OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { diff --git a/cmake/scripts/q7s/q7s-make-release.sh b/cmake/scripts/q7s/q7s-make-release.sh index d9b74bc3..0dc4d05f 100755 --- a/cmake/scripts/q7s/q7s-make-release.sh +++ b/cmake/scripts/q7s/q7s-make-release.sh @@ -20,7 +20,7 @@ else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" fi -if [[ -z "${EIVE_Q7S_EM}" ]]; then +if [[ ! -z "${EIVE_Q7S_EM}" ]]; then build_defs="EIVE_Q7S_EM=ON" fi diff --git a/fsfw b/fsfw index 80cb0e68..f59b05c8 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 80cb0e682fb423b4e7b8f45b66b3b5b7249e0d48 +Subproject commit f59b05c86cd54390d2a259eda770ee7935587112 diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 02130d6b..b1d0a218 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -29,6 +29,35 @@ ReturnValue_t pst::pstGpio(FixedTimeslotTaskIF *thisSequence) { return HasReturnvaluesIF::RETURN_FAILED; } +ReturnValue_t pst::pstSpiRw(FixedTimeslotTaskIF *thisSequence) { + uint32_t length = thisSequence->getPeriodMs(); + static_cast(length); + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW1, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW1, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW1, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * 0.5, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0.65, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ); + return thisSequence->checkSequence(); +} + ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); static_cast(length); @@ -330,32 +359,6 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { } #endif /* OBSW_ADD_SUN_SENSORS == 1 */ -#if OBSW_ADD_RW == 1 - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW1, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.5, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.65, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.5, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.65, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.5, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.65, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.5, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.65, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ); -#endif - #if OBSW_ADD_ACS_BOARD == 1 && OBSW_ADD_ACS_HANDLERS == 1 bool enableAside = true; bool enableBside = true; diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 19c86e52..2f5a84cb 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -46,6 +46,8 @@ ReturnValue_t pstUart(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstSpi(FixedTimeslotTaskIF* thisSequence); +ReturnValue_t pstSpiRw(FixedTimeslotTaskIF *thisSequence); + ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence); /** diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 781382ae..02bc7b5f 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -849,7 +849,7 @@