#include "Scheduler.h"
Functions | |
bool | Scheduler_HasDelayElapsed (const uint16_t Delay, SchedulerDelayCounter_t *const DelayCounter) |
void | Scheduler_SetTaskMode (const TaskPtr_t Task, const bool TaskStatus) |
void | Scheduler_SetGroupTaskMode (const uint8_t GroupID, const bool TaskStatus) |
Variables | |
volatile SchedulerDelayCounter_t | Scheduler_TickCounter |
volatile uint8_t | Scheduler_TotalTasks |
bool Scheduler_HasDelayElapsed | ( | const uint16_t | Delay, | |
SchedulerDelayCounter_t *const | DelayCounter | |||
) |
Determines if the given tick delay has elapsed, based on the given .
Delay | The delay to test for, measured in ticks | |
DelayCounter | The counter which is storing the starting tick value for the delay |
static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on startup // Task runs every 10000 ticks, 10 seconds for this demo if (Scheduler_HasDelayElapsed(10000, &DelayCounter)) { // Code to execute after delay interval elapsed here }
void Scheduler_SetGroupTaskMode | ( | const uint8_t | GroupID, | |
const bool | TaskStatus | |||
) |
Sets the task mode for a given task group ID, allowing for an entire group of tasks to have their statuses changed at once.
GroupID | Value of the task group ID whose status is to be changed | |
TaskStatus | New task status for tasks in the specified group (TASK_RUN or TASK_STOP) |
void Scheduler_SetTaskMode | ( | const TaskPtr_t | Task, | |
const bool | TaskStatus | |||
) |
Sets the task mode for a given task.
Task | Name of the task whose status is to be changed | |
TaskStatus | New task status for the task (TASK_RUN or TASK_STOP) |
Contains the current scheduler tick count, for use with the delay functions. If the delay functions are used in the user code, this should be incremented each tick period so that the delays can be calculated.
volatile uint8_t Scheduler_TotalTasks |
Contains the total number of tasks in the task list, irrespective of if the task's status is set to TASK_RUN or TASK_STOP.