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

- File List
- Globals

# scheduler.c File Reference

,vThis file contains the scheduler routines More...

`#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 ______________________________________________
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

,vThis file contains the scheduler routines

Copyright (c) 2004 Atmel.

Please read file license.txt for copyright notice.

Configuration:

- SCHEDULER_TYPE in scheduler.h header file
- Task & init for at least task number 1 must be defined

Version:
  1.11 at90usb162-2enum-mouse_ms-1_0_1
  Id
    scheduler.c,v 1.11 2005/03/10 08:30:50 lguilhau Exp

Todo:

Bug:

Definition in file scheduler.c.

## Define Documentation

#define _SCHEDULER_C_

_____ I N C L U D E S ____________________________________________________

Definition at line 18 of file scheduler.c.

## Function Documentation

void scheduler_init | ( | void |  | ) |

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

References Scheduler_call_next_init, Scheduler_task_1_init, Scheduler_task_2_init, and Scheduler_task_3_init.

Referenced by scheduler().

    00050 {
    00051    #ifdef Scheduler_time_init
    00052       Scheduler_time_init();
    00053    #endif
    00054    #ifdef TOKEN_MODE
    00055       token =  TOKEN_FREE;
    00056    #endif
    00057    #ifdef Scheduler_task_1_init
    00058       Scheduler_task_1_init();
    00059       Scheduler_call_next_init();
    00060    #endif
    00061    #ifdef Scheduler_task_2_init
    00062       Scheduler_task_2_init();
    00063       Scheduler_call_next_init();
    00064    #endif
    00065    #ifdef Scheduler_task_3_init
    00066       Scheduler_task_3_init();
    00067       Scheduler_call_next_init();
    00068    #endif
    00069    #ifdef Scheduler_task_4_init
    00070       Scheduler_task_4_init();
    00071       Scheduler_call_next_init();
    00072    #endif
    00073    #ifdef Scheduler_task_5_init
    00074       Scheduler_task_5_init();
    00075       Scheduler_call_next_init();
    00076    #endif
    00077    #ifdef Scheduler_task_6_init
    00078       Scheduler_task_6_init();
    00079       Scheduler_call_next_init();
    00080    #endif
    00081    #ifdef Scheduler_task_7_init
    00082       Scheduler_task_7_init();
    00083       Scheduler_call_next_init();
    00084    #endif
    00085    #ifdef Scheduler_task_8_init
    00086       Scheduler_task_8_init();
    00087       Scheduler_call_next_init();
    00088    #endif
    00089    #ifdef Scheduler_task_9_init
    00090       Scheduler_task_9_init();
    00091       Scheduler_call_next_init();
    00092    #endif
    00093    #ifdef Scheduler_task_10_init
    00094       Scheduler_task_10_init();
    00095       Scheduler_call_next_init();
    00096    #endif
    00097    #ifdef Scheduler_task_11_init
    00098       Scheduler_task_11_init();
    00099       Scheduler_call_next_init();
    00100    #endif
    00101    Scheduler_reset_tick_flag();
    00102 }

void scheduler_tasks | ( | void |  | ) |

Task execution scheduler.

Warning:
  Code:XX bytes (function code length)

Parameters:

  | :none |

Returns:
  :none

Definition at line 110 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().

    00111 {
    00112    // To avoid uncalled segment warning if the empty function is not used
    00113    scheduler_empty_fct();
    00114
    00115    for(;;)
    00116    {
    00117       Scheduler_new_schedule();
    00118       #ifdef Scheduler_task_1
    00119          Scheduler_task_1();
    00120          Scheduler_call_next_task();
    00121       #endif
    00122       #ifdef Scheduler_task_2
    00123          Scheduler_task_2();
    00124          Scheduler_call_next_task();
    00125       #endif
    00126       #ifdef Scheduler_task_3
    00127          Scheduler_task_3();
    00128          Scheduler_call_next_task();
    00129       #endif
    00130       #ifdef Scheduler_task_4
    00131          Scheduler_task_4();
    00132          Scheduler_call_next_task();
    00133       #endif
    00134       #ifdef Scheduler_task_5
    00135          Scheduler_task_5();
    00136          Scheduler_call_next_task();
    00137       #endif
    00138       #ifdef Scheduler_task_6
    00139          Scheduler_task_6();
    00140          Scheduler_call_next_task();
    00141       #endif
    00142       #ifdef Scheduler_task_7
    00143          Scheduler_task_7();
    00144          Scheduler_call_next_task();
    00145       #endif
    00146       #ifdef Scheduler_task_8
    00147          Scheduler_task_8();
    00148          Scheduler_call_next_task();
    00149       #endif
    00150       #ifdef Scheduler_task_9
    00151          Scheduler_task_9();
    00152          Scheduler_call_next_task();
    00153       #endif
    00154       #ifdef Scheduler_task_10
    00155          Scheduler_task_10();
    00156          Scheduler_call_next_task();
    00157       #endif
    00158       #ifdef Scheduler_task_11
    00159          Scheduler_task_11();
    00160          Scheduler_call_next_task();
    00161       #endif
    00162    }
    00163 }

Here is the call 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 171 of file scheduler.c.

References scheduler_init(), and scheduler_tasks().

Referenced by main().

    00172 {
    00173    scheduler_init();
    00174    scheduler_tasks();
    00175 }

Here is the call 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 185 of file scheduler.c.

Referenced by scheduler_tasks().

    00186 {
    00187 }