If your LEDs are flashing at all...congratulations!
At least something works.

Can you send more detail about the program --
what's PULSE_INT_MODE(0) (I'm not familiar with it if it's a TOS thing),
and what is happening that you don't expect?
Also what are you using to drive the interrupt?
If it's a switch it probably needs de-bouncing.

MS


Meiying Su wrote:
> Dear All,
> are you availabe now ?could you give me a favor? I have written a module 
> which can response the external interrupe1.The code is following
> [code]
> module HPLPulse {
>     provides interface StdControl;
>      uses
>      {
>      interface Leds;
>      }
> }
> implementation
> {
>     uint8_t pulseValue;//
>    
>     command result_t StdControl.init() {
>       atomic {
>     PULSE_INT_MODE(0);// the downing edge
>     PULSE_INT_DISABLE();
>     pulseValue = 0;
>       }
>      call Leds.init();
>       return SUCCESS;
>     }
> 
>     command result_t StdControl.start() {
>       PULSE_INT_ENABLE();
>       return SUCCESS;
>     }
> 
>     command result_t StdControl.stop() {
>     
>      
>       return SUCCESS;
>     }
> 
>   TOSH_INTERRUPT(SIG_INTERRUPT1) {
>   atomic{
>     pulseValue++;//脉冲数加1
>       if (pulseValue & 1) call Leds.redOn();
>       else call Leds.redOff();
>       if (pulseValue & 2) call Leds.yellowOn();
>       else call Leds.yellowOff();
>       if (pulseValue & 4) call Leds.greenOn();
>       else call Leds.greenOff();
>    }
>   }
> 
> }
>  
> In the code I have set a variable as pulseValue,when the interrupt 
> comming ,the vairable pulseValue will increnments 1,and we can notice 
> that the leds would on or off.In my experiment,when I run the 
> application, the result of leds  will  be not consistent with my 
> expectation.
> But when i use dbg tools to debug the code step by step, the code is 
> right.could you give me some comments?
> 
> thanks in advance
>  
> ps. I use the tinyos 1.15 version .
> 
> Best Regards
> Sophia Su
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to