On Wed, May 6, 2020 at 11:42 AM anita patil <anitha.bija...@gmail.com> wrote:
> What is the flow of NesC program execution? > same as C. The Blink application with three LEDs i.e LED0, LED1, LED2 if I want to > switch ON with three Timers i.e Timer0, Timer1, Timer2 , Which order > the compiler consider for execution > > 1) The order I use to call the commands in Module file's Boot.booted event > event void Boot.booted() > > { > call Timer1.startPeriodic( 1500); > call Timer2.startPeriodic( 1500); > call Timer0.startPeriodic( 1500); > } > The compiler will first generate code for Timer1.startPeriodic, then Timer2, etc. This code will update the data structure that implements the Tmilli virtual timers. > OR > > 2) The order I use to declare the components Timer0, Timer1, Timer2 > in configuration file > implementation > > { > > components MainC, BlinkC, LedsC; > components new TimerMilliC() as Timer0; > components new TimerMilliC() as Timer1; > components new TimerMilliC() as Timer2; > .............. > } > configuration determines wiring and how modules are connected to each other. A side effect of this is it determines the order in which modules are processed. Which determines the order that code is presented to the compiler. to see the order of processing use the "verbose" option to the "make <platform>" command line... ie. "make <platform> verbose" > > All examples of apps folder are talking the 2nd method I wrote above i.e > considering the order of configuration file component declaration. > I don't think so. Run the compile in the apps folder with "verbose" and look at the order. If you still thinks it lays the code done in component order, give me another jingle (cire...@gmail.com) and I'll look at it. > But apps/tests/TestScheduler and > apps/tests/arbiters/TestFcfsArbiter > are talking the 1st method I wrote above i.e considering the order of > module file's Boot.booted event calls. > > > Thank you. > _______________________________________________ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help