Contiki的Rtime只支持一个Timer

在现有

http://www.myexception.cn/mobile/1436453.html

关于几个Timer的一个总结

Contiki源代码(Contiki版本3.X)中,在调用rtimer时,需要调用者获取当前的RITMER_NOW,然后在此基础上加上需要的time然后进行定时器调度。但是这样里边,如果存在多个定时任务的时候,如何处理呢?而且如果后一个定时任务的time正好小于前一个,又如何保证后一个被调用呢?在现有的rtimer中,没有看到这样的代码。由这份邮件列表的内容可以看到截止2013年11月16日,Contiki的Rtimer只支持1个Rtimer.

Message: 4
Date: Sat, 16 Nov 2013 17:35:16 +0100 (CET)
From: Beno?t Th?baudeau < [email protected] >
Subject: [Contiki-developers] [**SPAM**] Rtimer  limitations
To: Contiki developer mailing list
        < [email protected] >
Message-ID:
        < [email protected] >
Content-Type: text/plain; charset=utf-8

Hi all,

Rtimers are very useful in order to schedule hard real-time tasks, while Ctimers
may be delayed. However, looking at their implementation in
core/sys/ rtimer .{ c |h}, it seems that only a single  Rtimer  instance is supported
at once. This is a big issue since it means that only a single  Rtimer  can be
used in the firmware, or that  Rtimer  users have to know each other in order not
to make Rtimers collide. Is it the expected behavior? Moreover, this limitation
is not documented. Any comment?

Best regards,
Beno?t


------------------------------

Message: 5
Date: Sat, 16 Nov 2013 17:41:24 +0100
From: Adam Dunkels < [email protected] >
Subject: Re: [Contiki-developers] [**SPAM**] Rtimer  limitations
To: Contiki developer mailing list
        < [email protected] >
Message-ID:
        <CAEW- RJ5WHcsMjoTPXSFNMLhmyboJXV6L63 ctJ5xkCgJ66j= [email protected] >
Content-Type: text/plain; charset="iso-8859-1"

The  rtimer  API is supposed to support multiple rtimers but, yeah, the
implementation only supports one. Until we've got stable code for multiple
rtimers, this is what we have.

/adam


On Sat, Nov 16, 2013 at 5:35 PM, Beno?t Th?baudeau <
[email protected] > wrote:

你可能感兴趣的:(contiki,Rtimer)