tinyos-help,hi!
I want to use Hplclock module to generate a timer used in tossim.
I think after command HPLClock.init() is execused ,it should fired
every time when the TOSH_INTERRUPT arrives.
i write a simple app to test it , however, it seems i can't receive
clock.fire() after i init the Clock.
I hope you can give me some imformation,thanks a lot.
here is my app code:
configuration clocktest{ }
implementation
{
components Main,clocktestM,HPLClock,LedsC;
Main.StdControl -> clocktestM;
clocktestM.Leds -> LedsC;
clocktestM.Clock -> HPLClock;
}
module clocktestM
{ provides interface StdControl;
uses
{
interface Clock;
interface Leds;
}
}
implementation
{
#ifndef DEFAULT_SCALE
#define DEFAULT_SCALE 3
#endif
#ifndef DEFAULT_INTERVAL
#define DEFAULT_INTERVAL 255
#endif
command result_t StdControl.init(){
call Leds.init();
call Clock.setRate(DEFAULT_INTERVAL, DEFAULT_SCALE) ;
call Leds.yellowOn();
return SUCCESS;
}
command result_t StdControl.start(){
call Leds.greenOn();
return SUCCESS;
}
command result_t StdControl.stop(){
return SUCCESS;
}
async event result_t Clock.fire(){
call Leds.redOn();
return SUCCESS;
}
}
here is the simulate imformation:
$ ./build/pc/main.exe 1
SIM: EEPROM system initialized.
SIM: event queue initialized.
SIM: Random seed is 313529
SIM: Initializing sockets
SIM: Created server socket listening on port 10584.
SIM: Created server socket listening on port 10585.
SIM: Time for mote 0 initialized to 36311271.
0: BOOT: Scheduling for boot at 0:0:9.07781775.
SIM: eventAcceptThread running.
SIM: commandReadThread running.
0: Popping event for mote 0 with time 0:0:9.07781775.
0: Setting TOS_LOCAL_ADDRESS to 0
0: BOOT: Mote booting at time 0:0:9.07781775.
0: LEDS: initialized.
0: CLOCK: Setting clock rate to interval 0, scale 3
0: LEDS: Yellow on.
0: LEDS: Green on.
roy liu ^-^
[EMAIL PROTECTED]
2006-11-24
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help