Janos,

Ok, I have a guss what it could be: reentering the same interrupt
twice with the following sequence:

- UART first interrupt starts
- RF interrupt starts
- UART second interrupt starts and ends
- RF interrupt ends
- UART first interrupt ends

You can check this if you do something like this:

uint8_t inprogress;

AVR_NONATOMIC_HANDLER(SIG_USART1_TRANS)
{
  if( inprogress != 0 )
    call Leds.led0Toggle();
  else
  {
    inprogress = 1;
    signal HplUart1.txDone();
    inprogress = 0;
  }
}

Can you give this a try?

Miklos

On Fri, Feb 27, 2009 at 7:44 PM, Miklos Maroti <[email protected]> wrote:
>> - It sets the TX complete flag when enabling the tx interrupt. I
>> suppose that this results in the tx interrupt being fired without
>> actually sending out anything. Removing this might solve the problem.
>
> If you think about these:
>
>    SET_BIT(UCSR1A, TXC1);
>    SET_BIT(UCSR1B, TXCIE1);
>
> Then it is ok, the first just clears the interrupt file register.
> However, it should probably be protected by an atomic section. But
> this is such a small race condition, so I think this is not the one
> being triggered, probably something higher up.
>
> Miklos
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to