hi,everyone!
I have fix the problem, the INTERVAL could not be 255,that would be
considered 0 infact.
After i change it to 127,the clock can fire.
But now i have another problem, i have found
TOS_SIGNAL_HANDLER(SIG_OUTPUT_COMPARE2B, ()) and
TOS_SIGNAL_HANDLER(SIG_OUTPUT_COMPARE2, ()) are used in tossim. I think the
tinyos just have two time/count ,so what the different
between them?
thx for your reply.
======= 2006-11-24 01:43:04 roy liu ^-^ write:=======
>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
>
>
>
= = = = = = = = = = = = = = = = = = = =
roy liu ^-^
[EMAIL PROTECTED]
2006-11-24
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help