Skip to content
Snippets Groups Projects
Commit 40b63c94 authored by Xhulio Luli's avatar Xhulio Luli Committed by athatheo
Browse files

St11 task notifier

parent 88783b12
No related branches found
No related tags found
No related merge requests found
......@@ -191,8 +191,23 @@ void ParameterService::initializeParameterMap() {
parameters = {{0, parameter1}, {1, parameter2}, {2, parameter3}};
}
```
2. @ref TimeBasedSchedulingService::notifyNewActivityAddition
2. @ref ParameterStatisticsService::initializeStatisticsMap
The TimeBasedSchedulingService is responsible for storing the activities/TCs to be executed. However, if this list of
stored activities is emptied, the Platform Task responsible to execute these TCs should be paused. With this
function, a notifier can be implemented and called by `TimeBasedScheduling::insertActivities()` to notify the
Task to restart after a new activity is inserted.
An example implementation for FreeRTOS can be as follows:
```cpp
void TimeBasedSchedulingService::notifyNewActivityAddition() {
if (scheduledActivities.size() >= 1) {
xTaskNotify(TaskList::timeBasedSchedulingTask->taskHandle, 0, eNoAction);
}
}
```
3. @ref ParameterStatisticsService::initializeStatisticsMap
The function is called by the constructor of the class, making sure that the statistics will be initialized properly
after creating an instance of the ST04 Service. This function should be implemented according to the specific
......
......@@ -115,11 +115,12 @@ private:
*/
friend struct ::unit_test::Tester;
public:
/*
* ST[11] TimeBased Scheduling Service and Sub-Service Macros, for readability purpose
*/
/**
* Notifies the timeBasedSchedulingTask after the insertion of activities to scheduleActivity list.
*/
void notifyNewActivityAddition();
public:
inline static const uint8_t ServiceType = 11;
enum MessageType : uint8_t {
......
#include "ECSS_Configuration.hpp"
#ifdef SERVICE_TIMESCHEDULING
#include "Services/TimeBasedSchedulingService.hpp"
void TimeBasedSchedulingService::notifyNewActivityAddition() {}
#endif
\ No newline at end of file
......@@ -71,6 +71,7 @@ void TimeBasedSchedulingService::insertActivities(Message& request) {
}
}
sortActivitiesReleaseTime(scheduledActivities);
notifyNewActivityAddition();
}
void TimeBasedSchedulingService::timeShiftAllActivities(Message& request) {
......
......@@ -109,6 +109,8 @@ void ParameterService::initializeParameterMap() {
{static_cast<uint16_t>(11), PlatformParameters::parameter12}};
}
void TimeBasedSchedulingService::notifyNewActivityAddition() {}
void ParameterStatisticsService::initializeStatisticsMap() {
statisticsMap = {};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment