Esempio n. 1
0
void LIST_INIT(list_t *listroot)
{
  ASSERT(listroot);
  LIST_NODE_INIT(&listroot->listhead);
  listroot->length = 0;
}
Esempio n. 2
0
/**
 * Author:   SMC<*****@*****.**>
 * Date:     2017-06-13
 * Describe: This is a part of SMC-RTOS for timer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include "smc_timer.h"
#include "smc_list.h"
#include "smc_cpu.h"
#include "smc_core.h"

static smc_list_head_t smc_timer_resume_list = 
	LIST_NODE_INIT(smc_timer_resume_list);                /* Timer need to resume  list */

static smc_list_head_t smc_timer_list = 
	LIST_NODE_INIT(smc_timer_list);                       /* thread for all need to delay list head */

/**
 * This function will init a timer
 *
 * @param timer     [the timer to be initialized]
 * @param tick      [the tick to be delay]
 * @param timerout  [the function will be invoked when its delay time comes]
 * @param parameter [the function parameter]
 * @param flag      [the timer operater mode flag]
 */
void smc_timer_init(smc_timer_t *timer,
                    smc_uint32_t tick,