Elisa3
|
Manage the agendas (timer2) More...
Go to the source code of this file.
Data Structures | |
struct | AgendaType |
srtuct Agenda as chained list More... | |
Defines | |
#define | AG_ALREADY_CREATED 1 |
#define | AG_NOT_FOUND 2 |
Typedefs | |
typedef struct AgendaType | Agenda |
Functions | |
void | e_start_agendas_processing (void) |
Start the agendas processing. | |
void | e_end_agendas_processing (void) |
Stop all the agendas. | |
int | e_activate_agenda (void(*func)(void), int cycle) |
Activate an agenda. | |
int | e_destroy_agenda (void(*func)(void)) |
Destroy an agenda. | |
int | e_set_agenda_cycle (void(*func)(void), int cycle) |
Change the cycle value of an agenda. | |
int | e_reset_agenda (void(*func)(void)) |
Reset an agenda's counter. | |
int | e_pause_agenda (void(*func)(void)) |
Pause an agenda. | |
int | e_restart_agenda (void(*func)(void)) |
Restart an agenda previously paused. |
Manage the agendas (timer2)
This module manage the agendas with the timer2.
An agenda is a structure made to work as chained list. It containts: the function you want to launch, the time setup between two launching events, a counter to measure the current time, a pointer to the next element of the list.
Each times the timer2 has an interrupt, all the agenda chained list is scanned to look if an agenda has to be treated according to the cycle value and current counter value.
If one (or more) agenda has to be treated, his callback function is launch.
#define AG_ALREADY_CREATED 1 |
#define AG_NOT_FOUND 2 |
typedef struct AgendaType Agenda |
int e_activate_agenda | ( | void(*)(void) | func, |
int | cycle | ||
) |
Activate an agenda.
Activate an agenda and allocate memory for him if there isn't already an agenda with the same callback function (the agenda is active but isn't processed if he has a null cycle value).
func | function called if the cycle value is reached by the counter |
cycle | cycle value in millisec/10 |
int e_destroy_agenda | ( | void(*)(void) | func | ) |
Destroy an agenda.
Destroy the agenda with a given callback function.
func | function to test |
void e_end_agendas_processing | ( | void | ) |
Stop all the agendas.
Stop all the agendas by disabling Timer2
int e_pause_agenda | ( | void(*)(void) | func | ) |
Pause an agenda.
Pause an agenda but do not reset its information.
func | function to pause |
int e_reset_agenda | ( | void(*)(void) | func | ) |
Reset an agenda's counter.
Reset an agenda's counter with a given callback function.
func | function to reset |
int e_restart_agenda | ( | void(*)(void) | func | ) |
Restart an agenda previously paused.
Restart an agenda previously paused.
func | function to restart |
int e_set_agenda_cycle | ( | void(*)(void) | func, |
int | cycle | ||
) |
Change the cycle value of an agenda.
Change the cycle value of an agenda with a given callback function.
func | function to test |
cycle | new cycle value in millisec/10 |
void e_start_agendas_processing | ( | void | ) |
Start the agendas processing.
Start the agendas processing by starting the Timer2.