[Tinyos-devel] Proposed change to the serial stack in TinyOS 2

Matt Welsh mdw at eecs.harvard.edu
Thu Dec 14 16:06:33 PST 2006


Ben,

> 3) One could add a parameter to the HAL-level put() that signifies
> that putDone shouldn't come until the UART is idle. This has the
> benefit of only incurring the cost of spinning when needed, but is
> confusing, as no one aside from the user of put() can check for
> idleness.
>
> Our proposed solution is the following:
>
> 4) Add a split-phase query interface to the HAL with the command
> wait(). This interface would implement a task-level spin (so that it
> is interruptable) and would signal waitDone() when the idle flag is
> asserted. The downside of this interface is that it still relies on a
> spin, which consumes extra energy as the processor will not enter a
> sleep state while waiting.

I like it. I would suggest not using a new interface for this (unless  
one is strictly necessary - why not add the command/event to the  
existing UART interface?). And, perhaps to be consistent with more  
commonly used terminology you could call it flush() / flushDone().  
"wait" is a little ambiguous unless you make it clear what you are  
waiting for.

Overall I think this is the right approach as it means you can do the  
'flush' only when needed.
It would be good to document under what specific conditions flush  
should be used.







More information about the Tinyos-devel mailing list