[Tinyos-devel] UartStream interface
Vlado Handziski
vlado.handziski at gmail.com
Wed Dec 6 08:36:24 PST 2006
The problem is an aspect of the more general issue of efficiently detecting
end-of-transmission on double buffered platforms that don't provide
interrupt-based signaling for this (like the msp430). Take a look at the
minutes from the following core meetings:
http://tinyos.stanford.edu:8000/TinyOS_2.x_WG/06.28.2006
http://tinyos.stanford.edu:8000/TinyOS_2.x_WG/07.5.2006
as well as some mails in the core working group on the subject.
The core group plans to revisit this issue during the next review of the
Serial TEP (which happens to be today :) ). The busy waiting approach is
straightforward, but can cause significant overhead when used on low baud
rates and when the code happens to execute in atomic context. Some of the
proposed alternatives are to always send a dummy byte, posting a task to
signal the end, etc.
Vlado
On 12/6/06, Roman Lim <rlim at ee.ethz.ch> wrote:
>
> 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
>
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20061206/d8455da4/attachment.htm
More information about the Tinyos-devel
mailing list