Commit b5d86591 authored by Adam Wujek's avatar Adam Wujek

lib/wrs-tasks: rename two functions

Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 38791af8
......@@ -27,11 +27,11 @@ struct wrc_task {
unsigned long max_run_ticks; /* in ticks */
};
void wrc_tasks_init(void);
void wrc_tasks_preinit(void);
struct wrc_task* wrc_task_create( const char *name, void (*init)(void), int (*job)(void) );
void wrc_task_set_enable( struct wrc_task* task, int (*enabled)(void) );
struct wrc_task *wrc_task_get(int tid);
void wrc_start_all_tasks(void);
void wrc_tasks_run_inits(void);
void wrc_poll_all_tasks(void);
void wrc_tasks_accounting_init(void);
int wrc_task_not_yet(uint32_t *lastt, unsigned period);
......
......@@ -115,12 +115,12 @@ void wrc_task_set_enable( struct wrc_task* task, int (*enabled)(void) )
task->enabled = enabled;
}
void wrc_tasks_init()
void wrc_tasks_preinit(void)
{
memset(&tasks, 0, sizeof(struct wrc_task) * WRC_MAX_TASKS);
}
void wrc_poll_all_tasks()
void wrc_poll_all_tasks(void)
{
int i;
......@@ -131,7 +131,7 @@ void wrc_poll_all_tasks()
}
}
void wrc_start_all_tasks()
void wrc_tasks_run_inits(void)
{
int i;
......@@ -142,7 +142,7 @@ void wrc_start_all_tasks()
}
}
void wrc_tasks_accounting_init()
void wrc_tasks_accounting_init(void)
{
shw_pps_gen_get_time(NULL, &prev_nanos_for_profile);
/* get tics */
......
......@@ -274,7 +274,10 @@ static void create_tasks(void)
{
struct wrc_task *t;
wrc_tasks_init();
/* clear task table in case of a reset */
wrc_tasks_preinit();
/* create all other tasks */
wrc_task_create( "idle", NULL, NULL );
wrc_task_create( "check-link", NULL, wrc_check_link );
wrc_task_create( "uptime", init_uptime, update_uptime );
......@@ -336,7 +339,7 @@ int main(void)
wrc_initialize();
/* initialization of individual tasks */
wrc_start_all_tasks();
wrc_tasks_run_inits();
for (;;) {
// run all pending tasks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment