Scheduler.c File Reference

#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

Function Documentation

bool Scheduler_HasDelayElapsed ( const uint16_t  Delay,
SchedulerDelayCounter_t *const   DelayCounter 
)

Determines if the given tick delay has elapsed, based on the given .

Parameters:
Delay The delay to test for, measured in ticks
DelayCounter The counter which is storing the starting tick value for the delay
Returns:
Boolean true if the delay has elapsed, false otherwise
Usage Example:
      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.

Parameters:
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.

Parameters:
Task Name of the task whose status is to be changed
TaskStatus New task status for the task (TASK_RUN or TASK_STOP)


Variable Documentation

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.

Note:
This value should be treated as read-only, and never altered in user-code.


Generated on Thu Oct 2 18:01:18 2008 for MyUSB Library by  doxygen 1.5.5