ATMEL: scheduler.c File Reference

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# scheduler.c File Reference

`#include "config.h"`
`#include "conf/conf_scheduler.h"`
`#include "scheduler.h"`

Include dependency graph for scheduler.c:

Go to the source code of this file.

## Defines

#define | _SCHEDULER_C_
| _____ I N C L U D E S ____________________________________________________

## Functions

void | scheduler_init (void)
| _____ D E C L A R A T I O N ______________________________________________ Scheduler initialization
void | scheduler_tasks (void)
| Task execution scheduler.
void | scheduler (void)
| Init & run the scheduler.
void | scheduler_empty_fct (void)
| Do nothing Avoid uncalled segment warning if the empty function is not used.

## Variables

bit | scheduler_tick_flag
| _____ M A C R O S ________________________________________________________ _____ D E F I N I T I O N ________________________________________________

## Detailed Description

This file contains the scheduler routines Configuration:

- SCHEDULER_TYPE in scheduler.h header file
- Task & init for at least task number 1 must be defined - Compiler: IAR EWAVR and GNU GCC for AVR

Supported devices: AT90USB1287, AT90USB1286, AT90USB647, AT90USB646

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file scheduler.c.

## Define Documentation

#define _SCHEDULER_C_

_____ I N C L U D E S ____________________________________________________

Definition at line 46 of file scheduler.c.

## Function Documentation

void scheduler_init | ( | void |  | ) |

_____ D E C L A R A T I O N ______________________________________________ Scheduler initialization

_____ D E C L A R A T I O N ______________________________________________

Task_x_init() and Task_x_fct() are defined in config.h

Warning:
  Code:XX bytes (function code length)

Parameters:

  | :none |

Returns:
  :none

Definition at line 77 of file scheduler.c.

Referenced by scheduler().

    00078 {
    00079    #ifdef Scheduler_time_init
    00080       Scheduler_time_init();
    00081    #endif
    00082    #ifdef TOKEN_MODE
    00083       token =  TOKEN_FREE;
    00084    #endif
    00085    #ifdef Scheduler_task_1_init
    00086       Scheduler_task_1_init();
    00087       Scheduler_call_next_init();
    00088    #endif
    00089    #ifdef Scheduler_task_2_init
    00090       Scheduler_task_2_init();
    00091       Scheduler_call_next_init();
    00092    #endif
    00093    #ifdef Scheduler_task_3_init
    00094       Scheduler_task_3_init();
    00095       Scheduler_call_next_init();
    00096    #endif
    00097    #ifdef Scheduler_task_4_init
    00098       Scheduler_task_4_init();
    00099       Scheduler_call_next_init();
    00100    #endif
    00101    #ifdef Scheduler_task_5_init
    00102       Scheduler_task_5_init();
    00103       Scheduler_call_next_init();
    00104    #endif
    00105    #ifdef Scheduler_task_6_init
    00106       Scheduler_task_6_init();
    00107       Scheduler_call_next_init();
    00108    #endif
    00109    #ifdef Scheduler_task_7_init
    00110       Scheduler_task_7_init();
    00111       Scheduler_call_next_init();
    00112    #endif
    00113    #ifdef Scheduler_task_8_init
    00114       Scheduler_task_8_init();
    00115       Scheduler_call_next_init();
    00116    #endif
    00117    #ifdef Scheduler_task_9_init
    00118       Scheduler_task_9_init();
    00119       Scheduler_call_next_init();
    00120    #endif
    00121    #ifdef Scheduler_task_10_init
    00122       Scheduler_task_10_init();
    00123       Scheduler_call_next_init();
    00124    #endif
    00125    #ifdef Scheduler_task_11_init
    00126       Scheduler_task_11_init();
    00127       Scheduler_call_next_init();
    00128    #endif
    00129    Scheduler_reset_tick_flag();
    00130 }

Here is the caller graph for this function:

void scheduler_tasks | ( | void |  | ) |

Task execution scheduler.

Warning:
  Code:XX bytes (function code length)

Parameters:

  | :none |

Returns:
  :none

Definition at line 138 of file scheduler.c.

Referenced by scheduler().

    00139 {
    00140    // To avoid uncalled segment warning if the empty function is not used
    00141    scheduler_empty_fct();
    00142
    00143    for(;;)
    00144    {
    00145       Scheduler_new_schedule();
    00146       #ifdef Scheduler_task_1
    00147          Scheduler_task_1();
    00148          Scheduler_call_next_task();
    00149       #endif
    00150       #ifdef Scheduler_task_2
    00151          Scheduler_task_2();
    00152          Scheduler_call_next_task();
    00153       #endif
    00154       #ifdef Scheduler_task_3
    00155          Scheduler_task_3();
    00156          Scheduler_call_next_task();
    00157       #endif
    00158       #ifdef Scheduler_task_4
    00159          Scheduler_task_4();
    00160          Scheduler_call_next_task();
    00161       #endif
    00162       #ifdef Scheduler_task_5
    00163          Scheduler_task_5();
    00164          Scheduler_call_next_task();
    00165       #endif
    00166       #ifdef Scheduler_task_6
    00167          Scheduler_task_6();
    00168          Scheduler_call_next_task();
    00169       #endif
    00170       #ifdef Scheduler_task_7
    00171          Scheduler_task_7();
    00172          Scheduler_call_next_task();
    00173       #endif
    00174       #ifdef Scheduler_task_8
    00175          Scheduler_task_8();
    00176          Scheduler_call_next_task();
    00177       #endif
    00178       #ifdef Scheduler_task_9
    00179          Scheduler_task_9();
    00180          Scheduler_call_next_task();
    00181       #endif
    00182       #ifdef Scheduler_task_10
    00183          Scheduler_task_10();
    00184          Scheduler_call_next_task();
    00185       #endif
    00186       #ifdef Scheduler_task_11
    00187          Scheduler_task_11();
    00188          Scheduler_call_next_task();
    00189       #endif
    00190    }
    00191 }

Here is the caller graph for this function:

void scheduler | ( | void |  | ) |

Init & run the scheduler.

Warning:
  Code:XX bytes (function code length)

Parameters:

  | :none |

Returns:
  :none

Definition at line 199 of file scheduler.c.

Referenced by main().

    00200 {
    00201    scheduler_init();
    00202    scheduler_tasks();
    00203 }

Here is the caller graph for this function:

void scheduler_empty_fct | ( | void |  | ) |

Do nothing Avoid uncalled segment warning if the empty function is not used.

Warning:
  Code:XX bytes (function code length)

Parameters:

  | :none |

Returns:
  :none

Definition at line 213 of file scheduler.c.

Referenced by scheduler_tasks().

    00214 {
    00215 }

Here is the caller graph for this function:

## Variable Documentation

bit scheduler_tick_flag

_____ M A C R O S ________________________________________________________ _____ D E F I N I T I O N ________________________________________________

_____ D E F I N I T I O N ________________________________________________

When SCHEDULER_TYPE != SCHEDULER_FREE, this flag control task calls.

Definition at line 56 of file scheduler.c.