I have found a workaround for this one. I have put the
     call TimeoutTimer.startOneShot(5000);
into a task and posted it. In my case this works because the timer
does not have to be very accurate.

Maybe it has something to do with this bug in the tracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=1572439&group_id=28656&atid=393934
I have not tried the suggested solution from there.

Perhaps this can help somebody ;)

Nicola

2008/6/18 Nicola Wegner <[EMAIL PROTECTED]>:
> Hi,
> it seems as my last message from 16th of June has not been send to the
> list members. At least a colleague of mine and myself did not receive
> it although it is listed on the web. Can anybody approve this?
> However here it is again:
>
>
> Hi,
>
> I am stuck with a strange problem. I have two modules M1 and M2 which
> contain a milliseconds timer each. After M1 has finished some
> processing and has stopped its timer it signals an event to a module
> at a higher level which then starts a function in M2. This function in
> M2 starts a timer which is immediately fired after setting it up with
> startPeriodic(..) or startOneShot(...), no matter what value I set as
> delay.
>
> I used LocalTime.get() from HilTimerMilliC to check when the second
> timer fires. When the first timer (in M1) fires once with a delay of
> 1000 milliseconds then the second timer is fired at 1008 ms (value
> from LocalTime.get() ) no matter if I start the timer with 500, 5000
> or 5000000 ms of delay.
>
> When I do not use M1 at all and call M2 directly it works.
>
> Is it possible that there are any interferences between the two timers?
>
> The timer parts of the code look like this, should be OK in my eyes:
>
> M1
> ----
> components new TimerMilliC() as Timer0;
> M1.RetryTimer -> Timer0;
> [...]
> uses interface Timer<TMilli> as RetryTimer;
> [...]
> call RetryTimer.startPeriodic(1000);
> [...]
> event void RetryTimer.fired() {
>   RetryTimer.stop();
>   signal [...]
> }
>
> M2
> ----
> components new TimerMilliC() as Timer1;
> M2.TimeoutTimer -> Timer1;
> [...]
> interface Timer<TMilli> as TimeoutTimer;
> [...]
> call TimeoutTimer.startOneShot(5000);
> [...]
> event void TimeoutTimer.fired() {
>       // Debug
>       printf("TimeSync timeout at %d ms.\n", call LocalTime.get());
>       printf("TimeSync time delay %d ms.\n", call TimeoutTimer.getdt());
> }
>
> Any ideas?
>
> Thanks in advance
>
> Nicola
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to