the simple following code should blink the red led on and off every time a
msg has received (if the ). I don't understand why sometimes it does not
happen. Does genericcomm uses timer3, or there is another problem in that
code? thank you

  event TOS_MsgPtr ReceiveMsg.receive( TOS_MsgPtr m) {
     uint16_t init_time_random;
     if(  ((struct cmd_msg *)m->data)->cmd == START ) {
    ETIMSK = 0x00; //disable timer 3
    TCNT3 = 0x00;
    call Leds.redOn();

    call GenericComm.stop(); // stop the regular radio drivers

    TCCR3A = 0x00;
    TCCR3B = 0x04;  // prescaler: 256

    OCR3BH = 0xAF;   // about half a second
    OCR3BL = 0xC8;
    ETIMSK = 0x3E8;  // enable compare register 3B
     }
     return m;
  }

  TOSH_SIGNAL( SIG_OUTPUT_COMPARE3B ) {
     TCNT3 = 0x00;
     ETIMSK = 0x00;
     call Leds.redOff();

     call CommControl.init();
     call CommControl.start();
  }
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to