Defines | Functions

# scheduler.c File Reference

This file contains the scheduler routines. More...

`#include "config.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)
| _____ M A C R O S ________________________________________________________ _____ D E F I N I T I O N ________________________________________________
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.

## 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: ATmega32U4

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 49 of file scheduler.c.

## Function Documentation

void scheduler_init | ( | void | ) |

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

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

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

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 79 of file scheduler.c.

References Scheduler_call_next_init, Scheduler_task_1_init, and Scheduler_task_2_init.

Referenced by scheduler().

    {
       #ifdef Scheduler_time_init
          Scheduler_time_init();
       #endif
       #ifdef TOKEN_MODE
          token =  TOKEN_FREE;
       #endif
       #ifdef Scheduler_task_1_init
          Scheduler_task_1_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_2_init
          Scheduler_task_2_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_3_init
          Scheduler_task_3_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_4_init
          Scheduler_task_4_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_5_init
          Scheduler_task_5_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_6_init
          Scheduler_task_6_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_7_init
          Scheduler_task_7_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_8_init
          Scheduler_task_8_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_9_init
          Scheduler_task_9_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_10_init
          Scheduler_task_10_init();
          Scheduler_call_next_init();
       #endif
       #ifdef Scheduler_task_11_init
          Scheduler_task_11_init();
          Scheduler_call_next_init();
       #endif
       Scheduler_reset_tick_flag();
    }

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 140 of file scheduler.c.

References Scheduler_call_next_task, scheduler_empty_fct(), Scheduler_new_schedule, Scheduler_task_1, Scheduler_task_2, and Scheduler_task_3.

Referenced by scheduler().

    {
       // To avoid uncalled segment warning if the empty function is not used
       scheduler_empty_fct();

       for(;;)
       {
          Scheduler_new_schedule();
          #ifdef Scheduler_task_1
             Scheduler_task_1();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_2
             Scheduler_task_2();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_3
             Scheduler_task_3();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_4
             Scheduler_task_4();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_5
             Scheduler_task_5();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_6
             Scheduler_task_6();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_7
             Scheduler_task_7();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_8
             Scheduler_task_8();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_9
             Scheduler_task_9();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_10
             Scheduler_task_10();
             Scheduler_call_next_task();
          #endif
          #ifdef Scheduler_task_11
             Scheduler_task_11();
             Scheduler_call_next_task();
          #endif
       }
    }

Here is the call graph for this function:

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 201 of file scheduler.c.

References scheduler_init(), and scheduler_tasks().

Referenced by main().

    {
       scheduler_init();
       scheduler_tasks();
    }

Here is the call graph for this function:

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 215 of file scheduler.c.

Referenced by scheduler_tasks().

    {
    }

Here is the caller graph for this function: