I don't know how much of the TEP applies to T1. But I see what you are getting at and I may be incorrect in thinking that your Timer2 one-shot will keep firing. It may be that each start cancels the previous one. If that's the case and if Timer1 keeps firing, then Timer2 will never get a chance to fire.
At this point I'm also not sure about the interrupt behavior. It looks like Timer.fired() is called from a task, rather than from the actual interrupt routine so my guess is that they will be executed sequentially but with no guaranteed order. Seems like a few experiments are in order... MS BAI LI wrote: > Hi Michael, > > Thanks for your reply. I noticed in TEP102. It says: > > startPeriodic(dt) > cancel any previously running timer and set to fire in dt time units > from the time of invocation. The timer will fire periodically every > dt time units until stopped. > startOneShot(dt) > cancel any previously running timer and set to fire in dt time units > from the time of invocation. The timer will only fire once then stop. > But it is TinyOS2.x. I am using TinyOS1.x. Don't these rules apply to > the timer structure in TinyOS1.x? You said it will be overlapping > timers. In that case, I suppose running another timer doesn't cancel any > previous running timers. Right? > > And also It says previous running timers, If the program is executing > the code inside the timer.fired, Will that interrupt the code execution > and jump out of timer function? Thanks. > > Regards, > Peter > > On Sat, Apr 18, 2009 at 2:13 AM, Michael Schippling <[email protected] > <mailto:[email protected]>> wrote: > > I believe the first timer2 fire will be at 12000, > since it gets started on the first 2000 REPEAT fire. > However at that point timer1 will also fire and > you will start getting overlapping events as both > timers will effectively be on 2000 REPEAT cycles. > > MS > > BAI LI wrote: > > Hi, > I am confused about the timer strucuture. someone could clarify > it for me? Thanks. > In the following code, > ******************** > call Timer1.start(TIMER_REPEAT,2000); > event result_t Timer.fired(){ > call Timer2.start(TIMER_ONE_SHOT,10000); > } > ******************* > so the timer1 is triggered every 2000 time units. However, in > the timer1 strucuture, I have timer2 which will be triggered at > 10000 time units. What is the order to proceed the above code. > like the following? > trigger timer1 at 2000 > trigger timer1 at 4000 > trigger timer1 at 6000 > trigger timer1 at 8000 > trigger timer1 at 10000 > trigger timer2 at 10000? > Any help would be appreciated! > Regards, > Peter > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tinyos-help mailing list > [email protected] > <mailto:[email protected]> > > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
