Go to the documentation of this file.
24 #include <util/atomic.h>
62 static void ScheduleTable_handleScheduleTableStart(
ScheduleTableType scheduleTableID)
71 ScheduleTable_handleExpiryPoint(&
ScheduleTable_Cfg[scheduleTableID]->expiryPointList[0]);
84 if (
OS_EXTENDED && scheduleTableID >= INVALID_SCHEDULETABLE) {
98 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
121 if (
OS_EXTENDED && scheduleTableID >= INVALID_SCHEDULETABLE) {
136 if (start > currentTick) {
137 start -= currentTick;
138 }
else if (start < currentTick) {
151 if (
OS_EXTENDED && scheduleTableID >= INVALID_SCHEDULETABLE) {
157 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
178 &scheduleTableID_to,
sizeof(scheduleTableID_to));
180 if (
OS_EXTENDED && (scheduleTableID_from >= INVALID_SCHEDULETABLE || scheduleTableID_to >= INVALID_SCHEDULETABLE)) {
193 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
222 sizeof(scheduleStatus));
224 if (
OS_EXTENDED && scheduleTableID >= INVALID_SCHEDULETABLE) {
236 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
250 for (uint8_t i = 0; i < SCHEDULETABLE_COUNT; i++) {
256 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
277 ScheduleTable_handleExpiryPoint(&
ScheduleTable_Cfg[i]->expiryPointList[expiryPoint]);
298 ScheduleTable_handleScheduleTableStart(i);
345 if (SCHEDULETABLE_COUNT > 0) {
346 assert(SCHEDULETABLE_COUNT <= UINT8_MAX);
348 for (uint8_t i = 0; i < SCHEDULETABLE_COUNT; i++) {
355 ScheduleTable_handleScheduleTableStart(i);
enum StatusType_e StatusType
Type for status.
volatile uint8_t blockScheduling
Block scheduling.
Schedule tables management.
Operating system control.
uint64_t TickType
Data type of counter values.
Structure for expiry point.
struct scheduleTable_s * ScheduleTable_Cfg[]
Current schedule table control blocks.
Assert macros and functions.
StatusType ScheduleTable_NextScheduleTable(ScheduleTableType scheduleTableID_from, ScheduleTableType scheduleTableID_to)
Queue schedule table.
@ OSServiceId_NextScheduleTable
enum counters_e CounterType
Type for counter reference.
const struct scheduleTableExpiryActionTask_s * taskActionList
List of task activation actions (may be NULL if numTaskActions equals zero)
StatusType ScheduleTable_StartScheduleTableAbs(ScheduleTableType scheduleTableID, TickType start)
Start schedule table from absolute start.
StatusType Events_SetEvent(TaskType TaskID, EventMaskType events)
Set events.
#define OS_SET_ERROR_INFO1(serviceId, paramPtr1, size1)
Set error info with up to one parameter.
volatile uint8_t needSysTickEval
SysTick must be evaluated during timer interrupt.
enum scheduleTables_e ScheduleTableType
Type for schedule table reference.
StatusType ScheduleTable_StopScheduleTable(ScheduleTableType scheduleTableID)
Stop schedule table.
@ OSServiceId_StopScheduleTable
@ OSServiceId_GetScheduleTableStatus
const uint8_t numTaskActions
Length of taskActionList.
const TickType maxallowedvalue
Maximum allowed value of counter.
@ SCHEDULETABLE_STOPPED
Schedule table is stopped.
const EventMaskType event
Mask of events to set.
@ SCHEDULETABLE_NEXT
Schedule table is queued after another table.
#define assert(expression)
void ScheduleTable_startup(void)
Startup function for schedule table management.
StatusType Task_ActivateTask(TaskType TaskID)
Activate a task.
@ OSServiceId_StartScheduleTableAbs
StatusType ScheduleTable_StartScheduleTableRel(ScheduleTableType scheduleTableID, TickType offset)
Start schedule table from relative offset.
StatusType ScheduleTable_GetScheduleTableStatus(ScheduleTableType scheduleTableID, ScheduleTableStatusRefType scheduleStatus)
Get schedule table status.
const uint8_t numEventActions
Length of eventActionList.
const CounterType counter
Counter driving the schedule table.
struct resource_s * next
Pointer to next resource in resource queue.
volatile ScheduleTableStatusType currentState
Current state of the schedule table.
StatusType Counter_GetCounterValue(CounterType counterID, TickRefType value)
Read current counter value.
const TaskType task
ID of task to set events for.
const uint8_t numExpiryPoints
Length of expiryPointList.
volatile struct counter_s * Counter_Cfg[]
Current counter control blocks.
#define OS_SET_ERROR_INFO2(serviceId, paramPtr1, size1, paramPtr2, size2)
Set error info with up to two parameters.
volatile ScheduleTableType next
Schedule table queued after the current one.
void ScheduleTable_handleSysTick(void)
Handle system tick.
Operating System Control Block.
void ScheduleTable_handleTick(CounterType counter)
Handle tick.
const struct scheduleTableExpiryActionEvent_s * eventActionList
List of event activation actions (may be NULL if numEventActions equals zero)
#define OS_CALL_ERROR_HOOK(error)
Call error hook if configured.
@ OSServiceId_StartScheduleTableRel
ScheduleTableStatusType * ScheduleTableStatusRefType
Type of status reference.
@ SCHEDULETABLE_RUNNING
Schedule table is running.
volatile TickType currentTick
Current tick of the schedule table.
@ SCHEDULETABLE_PRE_RUNNING
Schedule table is running but not yet executing until the tick reaches zero.
const TaskType task
ID of task to activate.