快速入门


4.6 软件定时器

<pre><code>#include "wm_include.h" tls_os_timer_t *demo_os_timer = NULL; static void demo_os_timer_irq(void *ptmr, void *parg) {     pritnf("---&gt; os timer irq\n"); } void UserMain(void) {     printf("\n user task \n"); // 创建软件定时器 1s 循环定时     tls_os_status_t ret = tls_os_timer_create(&amp;demo_os_timer,                               demo_os_timer_irq,                               NULL, (1 * HZ), TRUE, NULL);     if (TLS_OS_SUCCESS == ret)         tls_os_timer_start(demo_os_timer); #if DEMO_CONSOLE     CreateDemoTask(); #endif //用户自己的task } </code></pre>

页面列表

ITEM_HTML