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

- File List
- Globals

# scheduler.c

Go to the documentation of this file.

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010
    00011
    00012
    00013
    00014
    00015
    00016
    00018 #define _SCHEDULER_C_
    00019 #include "config.h"                         // system definition
    00020 #include "conf/conf_scheduler.h"            // Configuration for the scheduler
    00021 #include "scheduler.h"                      // scheduler definition
    00022
    00023
    00026 #if SCHEDULER_TYPE != SCHEDULER_FREE
    00028 bit   scheduler_tick_flag;
    00029 #endif
    00030
    00031 #ifdef TOKEN_MODE
    00037 Uchar token;
    00038 #endif
    00039
    00049 void scheduler_init (void)
    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 }
    00103
    00110 void scheduler_tasks (void)
    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 }
    00164
    00171 void scheduler (void)
    00172 {
    00173    scheduler_init();
    00174    scheduler_tasks();
    00175 }
    00176
    00177
    00185 void scheduler_empty_fct (void)
    00186 {
    00187 }
    00188