[Tinyos-devel] UartStream interface
Roman Lim
rlim at ee.ethz.ch
Wed Dec 6 07:53:48 PST 2006
Hi
I just used the new UartStream interface (on tmote sky) and observed,
that the sendDone event is signaled a bit early.
if the application releases the resource after this event, the last byte
in the buffer is not sent.
I would suggest to change the following event in
/tinyos-2.x/tos/chips/msp430/usart/Msp430UartP.nc
to something like this:
async event void UsartInterrupts.txDone() {
if ( m_tx_pos < m_tx_len ) {
call Usart.tx( m_tx_buf[ m_tx_pos++ ] );
}
else {
uint8_t* buf = m_tx_buf;
while (!call Usart.isTxEmpty());
m_tx_buf = NULL;
signal UartStream.sendDone( buf, m_tx_len, SUCCESS );
}
}
regards
Roman
More information about the Tinyos-devel
mailing list