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

- File List
- Globals

# scheduler.h File Reference

,vThis file is the definition of the scheduler More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | Wait_semaphore(a) while(!(a)) (a) = FALSE
| _____ I N C L U D E S ____________________________________________________
#define | TASK_DUMMY 0x00
| _____ M A C R O S ________________________________________________________ Definition of Task ID.
#define | TASK_0 0x01
#define | TASK_1 0x02
#define | TASK_2 0x04
#define | TASK_3 0x08
#define | TASK_4 0x10
#define | TASK_5 0x20
#define | TASK_6 0x40
#define | TASK_7 0x80
#define | ALL_TASK (TASK_0|TASK_1|TASK_2|TASK_3|TASK_4|TASK_5|TASK_6|TASK_7)
#define | SCHEDULER_CUSTOM 0
| ----- Scheduler Types -----
#define | SCHEDULER_TIMED 1
#define | SCHEDULER_TASK 2
#define | SCHEDULER_FREE 3
#define | Scheduler_call_next_task()
#define | Scheduler_new_schedule()
#define | Scheduler_call_next_init()
## 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.
## Variables
bit | scheduler_tick_flag
| _____ D E F I N I T I O N ________________________________________________

## Detailed Description

,vThis file is the definition of the scheduler

Copyright (c) 2004 Atmel.

Please read file license.txt for copyright notice.

This file contains the scheduler definition and the task function to be executed by the scheduler NOTE: SCHEDULER_TICK & FPER are defined in config.h

Version:
  1.12 at90usb162-2enum-mouse_ms-1_0_1
  Id
    scheduler.h,v 1.12 2006/03/08 16:17:03 rletendu Exp

Todo:

Bug:

Definition in file scheduler.h.

## Define Documentation

#define Wait_semaphore | ( | a |  | ) | while(!(a)) (a) = FALSE

_____ I N C L U D E S ____________________________________________________

Definition at line 29 of file scheduler.h.

#define TASK_DUMMY 0x00

_____ M A C R O S ________________________________________________________ Definition of Task ID.

This ID is used to properly send the event to a specific task. Mind, it will be possible to send an event to many task by TASK_1 | TASK_0. The name of the define can be changed by another define. That customization should be done in the file mail_evt.h

Definition at line 38 of file scheduler.h.

#define TASK_0 0x01

Definition at line 39 of file scheduler.h.

#define TASK_1 0x02

Definition at line 40 of file scheduler.h.

#define TASK_2 0x04

Definition at line 41 of file scheduler.h.

#define TASK_3 0x08

Definition at line 42 of file scheduler.h.

#define TASK_4 0x10

Definition at line 43 of file scheduler.h.

#define TASK_5 0x20

Definition at line 44 of file scheduler.h.

#define TASK_6 0x40

Definition at line 45 of file scheduler.h.

#define TASK_7 0x80

Definition at line 46 of file scheduler.h.

#define ALL_TASK (TASK_0|TASK_1|TASK_2|TASK_3|TASK_4|TASK_5|TASK_6|TASK_7)

Definition at line 49 of file scheduler.h.

#define SCHEDULER_CUSTOM 0

----- Scheduler Types -----

Definition at line 53 of file scheduler.h.

#define SCHEDULER_TIMED 1

Definition at line 54 of file scheduler.h.

#define SCHEDULER_TASK 2

Definition at line 55 of file scheduler.h.

#define SCHEDULER_FREE 3

Definition at line 56 of file scheduler.h.

#define Scheduler_call_next_task | ( |  | ) |

Definition at line 177 of file scheduler.h.

Referenced by scheduler_tasks().

#define Scheduler_new_schedule | ( |  | ) |

Definition at line 180 of file scheduler.h.

Referenced by scheduler_tasks().

#define Scheduler_call_next_init | ( |  | ) |

Definition at line 183 of file scheduler.h.

Referenced by scheduler_init().

## 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 }

## Variable Documentation

bit scheduler_tick_flag

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