定时器工作原理
定时器主要是使用waitdog进行实现,周期处理是通过timer_timeout进行处理
资源
nuttx_posix_timer.md
闫刚 nuttx的posix的定时器原理
定时器模块初始化
主要是创建定时器的资源, 静态分配资源到链表中。

void weak_function timer_initialize(void)
{
#if CONFIG_PREALLOC_TIMERS > 0
int i;
/* Place all of the pre-allocated timers into the free timer list */
sq_init((FAR sq_queue_t *)&g_freetimers);
for (i = 0; i < CONFIG_PREALLOC_TIMERS; i++)
{
g_prealloctimers[i].pt_flags = PT_FLAGS_PREALLOCATED;
sq_addlast((FAR sq_entry_t *)&g_prealloctimers[i],
(FAR sq_queue_t *)&g_freetimers);
}<