Hi Sam, I haven't looked at TinyOS 1.x code in a while, but here is a guess anyways:
The line you refer to does not directly concern the timers. Main is a component that calls components first to initialize them and then to start them, so it is sort of the equivalent of main() function for TinyOS. When a mote boots, the Main component first calls the BlinkM init() function to give it a chance to do some initializations, like configuring hardware (I/O pins, for example) or initializing data structures with default values. When all components have initialized, the Main component calls the start() function of the other components, thus effectively starting the application. You could remove this line, but then you would need other means of starting the application. For instance, sometimes you need to wire the Main component also to other components. You could not do this, but call the init() and start() functions from within your own components. Cheers, Urs Renee Azhen wrote: > Dear all: > I am newer to TinyOS, when studying the case Blink, I am quite puzzled > about the code "Main.StdControl -> BlinkM.StdControl;" in Blink.nc. > > Why we need this? > > I think it is because that we need we need to initilize the Timer when this > application inits. So can we delete this code but write a function init() in > Timer interface, and in the function init() of BlinkM, we call the > timer.init(). > > Does this work? > thanks! > Sam _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
