Hi All,
I tried to use absolute timer to substitute a common repeated timer.
Below there is the code but I do not understand why the event
myClock.fired never happens. Thank you
implementation {
tos_time_t next_time;
tos_time_t actual_time;
command result_t StdControl.init() {
call Leds.init();
call Leds.yellowOff(); call Leds.redOff(); call Leds.greenOff();
return SUCCESS;
}
command result_t StdControl.start() {
actual_time = call TimeUtil.create(0, call Time.getLow32());
next_time = call TimeUtil.add(actual_time, call
TimeUtil.create(0, PERIOD) );
call myClock.set(next_time);
return SUCCESS;
}
command result_t StdControl.stop() {
return SUCCESS;
}
event result_t myClock.fired() {
call Leds.greenOn();
actual_time = call TimeUtil.create(0, call Time.getLow32 ());
next_time = call TimeUtil.add(actual_time, call
TimeUtil.create(0, PERIOD) );
call myClock.set(next_time);
return SUCCESS;
}
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help