summaryrefslogtreecommitdiff
path: root/examples/kernel/timer_control.c
diff options
context:
space:
mode:
authordzzxzz <[email protected]>2011-09-26 02:50:43 +0000
committerdzzxzz <[email protected]>2011-09-26 02:50:43 +0000
commit9bb329daee2f842a724d3cdede9413a839e5069c (patch)
treeb99b0af5cb1b5fa0b3ce26d9837636bef12aeece /examples/kernel/timer_control.c
parentb886a19bf95701b73f0e191b190d28795c5a8cfc (diff)
update kernel examples
fixed an error in timer_control.c git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1730 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'examples/kernel/timer_control.c')
-rw-r--r--examples/kernel/timer_control.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/kernel/timer_control.c b/examples/kernel/timer_control.c
index fdee627f58..f04521a752 100644
--- a/examples/kernel/timer_control.c
+++ b/examples/kernel/timer_control.c
@@ -13,6 +13,8 @@ static rt_uint8_t count;
/* 定时器超时函数 */
static void timeout1(void* parameter)
{
+ rt_tick_t timeout = 50;
+
rt_kprintf("periodic timer is timeout\n");
count ++;
@@ -20,7 +22,7 @@ static void timeout1(void* parameter)
if (count >= 8)
{
/* 控制定时器然后更改超时时间长度 */
- rt_timer_control(timer1, RT_TIMER_CTRL_SET_TIME, (void*)50);
+ rt_timer_control(timer1, RT_TIMER_CTRL_SET_TIME, (void *)&timeout);
count = 0;
}
}