蓝牙BLE---DA14683的软件定时器

版权声明:转载请注明出处。技术交流加微信:life5270 https://blog.csdn.net/JaLLs/article/details/86568643
void user_timer_cb(OS_TIMER xTimer)
{
     //add your code
}



/* Create the OS timer */
OS_TIMER rtc_dbg_h;
   rtc_dbg_h = OS_TIMER_CREATE("RCX",
                             OS_MS_2_TICKS(1000), OS_TIMER_SUCCESS,
                             (void *) OS_GET_CURRENT_TASK(), 
                             user_timer_cb);
                             OS_ASSERT(rtc_dbg_h);

 /* Start the OS timer */
 OS_TIMER_START(rtc_dbg_h, OS_TIMER_FOREVER);

看以上代码,一目了然, 没错,软件定时器就是这么简单。

猜你喜欢

转载自blog.csdn.net/JaLLs/article/details/86568643