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