Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
/home/ruud/Engineering/software/projects/golem-project-code/trunk/glm_scheduler.h File Reference

Takes care of multitasking between all tasks registered for this application. Each of these registered tasks should follow a state-machine design and should be non-blocking. More...

#include <stdbool.h>
#include "glm_intbase.h"
#include "glm_tick.h"

Go to the source code of this file.

Data Structures

struct  task_stats_t
 Container for storing a task's runtime performance. More...
 
struct  task_t
 Container for storing a task's scheduling parameters. More...
 

Functions

void scheduler_run ()
 Initializes the scheduler using the predefined task-list in file glm_conf_tasks.h and then runs the application's main loop which takes care of multitasking between all registered tasks. More...
 
void scheduler_abort ()
 Aborts a running scheduler.
 
void scheduler_stats (task_stats_t *a_stats)
 Get the overall scheduling slot statistics. More...
 
bool scheduler_task_stats (uint_base_t a_task, task_t *a_params, task_stats_t *a_stats)
 Obtain statistics for a specific task. More...
 

Detailed Description

Takes care of multitasking between all tasks registered for this application. Each of these registered tasks should follow a state-machine design and should be non-blocking.

Author
Ruud Beukema

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Todo:

Verify functioning of this component.

Add an example of use to the Doxygen documentation

Definition in file glm_scheduler.h.

Function Documentation

void scheduler_run ( )

Initializes the scheduler using the predefined task-list in file glm_conf_tasks.h and then runs the application's main loop which takes care of multitasking between all registered tasks.

This function only returns after scheduler_abort() has been called.

Definition at line 66 of file glm_scheduler.c.

void scheduler_stats ( task_stats_t a_stats)

Get the overall scheduling slot statistics.

These statistics reflect the minimum and maximum execution time within a slot and number slot overruns.

Parameters
a_statsPointer to variable in which to store a copy of the overall scheduling statistics.

Definition at line 166 of file glm_scheduler.c.

bool scheduler_task_stats ( uint_base_t  a_task,
task_t a_params,
task_stats_t a_stats 
)

Obtain statistics for a specific task.

These statistics reflect the minimum and maximum execution time of a task and its number slot overruns.

Parameters
a_taskThe task number as it appears in the task-list (see glm_conf_tasks.h) ranging from 0 to NR_OF_TASKS-1.
a_paramsPointer to the variable in which to store a copy of the task's scheduling parameters.
a_statsPointer to the variable in which to store a copy of the task's statistics.
Returns
TRUE if given task number is valid or FALSE if the task number is non-existing.

Definition at line 148 of file glm_scheduler.c.