FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches

Contains API prototype for the Scheduler Task Manager. More...

Files

file  task_manager_scheduler.c
 Implements API for the Scheduler Task Manager.

Functions

void TM_Scheduler (const scheduleEntry_t schedule[], uint8_t scheduleLength, uint32_t nextScheduleDeadline)
 Manages and synchronizes safety system and application Tasks from a user defined schedule.

Detailed Description

Contains API prototype for the Scheduler Task Manager.

Version
1.0.0-alpha.1

The Scheduler Task Manager is responsible for running both safety system and application specific Tasks when the device is initialized and has exited the Safe State.

UML Class Diagrams

UML Sequence Diagrams

Function Documentation

◆ TM_Scheduler()

void TM_Scheduler ( const scheduleEntry_t schedule[],
uint8_t scheduleLength,
uint32_t nextScheduleDeadline )

Manages and synchronizes safety system and application Tasks from a user defined schedule.

This function executes safety system and application-specific scheduler Tasks with fixed durations, while ensuring the FDTI of the system.

After clearing the Watchdog Timer, all Tasks in the schedule are executed in sequence. Once the Task manager has handled the last Task in the schedule, the Synchronous Watchdog Timer is cleared and sets a deadline for when the first task in the next schedule should run Tasks.

Note
The T_RunNextLatentFaultDiag and T_HandleNotificationErrors Tasks are intended to be included in each schedule by default.
The total duration of all tasks in the schedule, combined with the deadline, is intended to be slightly less than the configured watchdog timeout to ensure timely execution and clearing. See tips_and_tricks for information on extending the duration if the amount of application tasks demands it.
Parameters
scheduleArray of schedule entries with a Task function pointer and duration in system clock cycles. Any Task set to a NULL pointer is skipped. Duration is limited to a 24-bit value.
scheduleLengthNumber of entries in schedule. A value of '0' indicates an empty schedule and no application Tasks will run.
nextScheduleDeadlineDuration in system clock cycles for the time between completion of the last Task in the current schedule to calling the first Task in the next schedule.
Warning
An invalid Task function pointer in schedule leads to undefined behavior.
Passing a scheduleLength larger than the size of schedule results in undefined behavior.

Definition at line 33 of file task_manager_scheduler.c.