tc007_01_timer.c.svn-base

来自「RT-Thread是发展中的下一代微内核嵌入式实时操作系统」· SVN-BASE 代码 · 共 40 行

SVN-BASE
40
字号
/* * File      : tc001_thread.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://openlab.rt-thread.com/license/LICENSE * * Change Logs: * Date           Author       Notes * 2006-06-06     Bernard      the first version */#include <rtthread.h>struct rt_timer timer1;struct rt_timer timer2;void timeout1(void* parameter){	rt_kprintf("periodic timer is timeout\n");}void timeout2(void* parameter){	rt_kprintf("one shot timer is timeout\n");}int rt_application_init(){	rt_timer_init(&timer1, "timer1", timeout1, RT_NULL, 200, RT_TIMER_FLAG_PERIODIC);	rt_timer_init(&timer2, "timer2", timeout2, RT_NULL, 200, RT_TIMER_FLAG_ONE_SHOT);		rt_timer_start(&timer1);	rt_timer_start(&timer2);	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?