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

Philip Levis pal at cs.stanford.edu
Wed Dec 20 11:10:01 PST 2006


On Dec 15, 2006, at 2:22 PM, Michael Newman wrote:

> There are two parts of power management. It is fine for the user of a
> component to be required to express a  desire to use it by having  
> to do an
> Init at system startup, and then a START (on) to use it and a STOP  
> (off)
> when done. Internal to the driver the component itself turns the  
> required
> hardware on and off etc. It is this internal housekeeping that  
> should be
> hidden from the user especially when there are required delays. If  
> a flush
> is required after the user says stop before powering down the  
> hardware then
> that flush is part of the component and should be part of the STOP  
> hiding
> the need from the component user. I see no reason to expose the  
> flush, the
> higher layers do not need to know. (I agree that is should not be  
> async or
> wait during an async function.)
>

But what if a flush isn't always needed? That's the basic question.  
If all possible uses of the UART want the flush, then it makes sense  
to include it as part of the on/off logic. It's easy to make an  
"always flushes before off" layer on top of one that doesn't, while  
the opposite direction is not.

Phil


More information about the Tinyos-devel mailing list