Always a good place to start is with the provided documentation before
sending stuff to the lists.

For example, I did a very simple search of the repo:

from the top level...

find . -exec grep -nHi tosh_uwait \{\} \;

and got:

./doc/txt/tep102.txt:235:the TOSH_uwait macro from TinyOS 1.x.
./tos/platforms/shimmer/chips/sd/SDP.nc:142:    TOSH_uwait(60000);
./tos/platforms/shimmer/chips/msp430/msp430hardware.h:196:#define
TOSH_uwait(n)   brief_pause((((unsigned long long)n) * TARGET_DCO_KHZ * 1024
/ 1000000 - 2) / 3)
./tos/platforms/shimmer/chips/bluetooth/RovingNetworksP.nc:114:
 TOSH_uwait(5000);
./tos/platforms/shimmer/chips/bluetooth/RovingNetworksP.nc:128:
 TOSH_uwait(5000);
./tos/platforms/shimmer/chips/bluetooth/RovingNetworksP.nc:426:
 TOSH_uwait(15000);

Looking at line 235 of doc/txt/tep102.txt we see:



BusyWait
--------------------------------------------------------------------

The BusyWait interface allows for very short synchronous delays.
BusyWait should be used sparingly and when an Alarm would not be
reasonably efficient or accurate.  The BusyWait interface replaces
the TOSH_uwait macro from TinyOS 1.x.

BusyWait blocks for no less than the specified amount of time.  No
explicit upper bound is imposed on the enacted delay, though it is
expected that the underlying implementation spins in a busy loop until
the specified amount of time has elapsed.
::

  interface BusyWait<precision_tag,size_type>
  {
    async command void wait( size_type dt );
  }

wait(dt)
  block until at least dt time units have elapsed



Note:  use of BusyWait should be minimized because it as the name
implies busy waits keeping all other (except interrupt driven stuff) things
from running.

You most likely should find a different way to do the wait that doesn't
block
other things from running.  Although waiting for 5 uSecs isn't that onerous.
Which is what TOSH_uwait(5) would do.  The "u" stands for micro.


Hopefully this shows how to find the answers to simple questions in the
future.

eric


On Tue, Mar 9, 2010 at 9:08 AM, Li, Haixia <[email protected]> wrote:

> Hi all:
>    Can anyone tell me what the "TOSH_uwait(5)" means? This statement
> appeared in the Tinyos1. And I want to know how to use it in the tinyos 2.x.
> Thank you.
>
> Thanks,
> Haixia Li
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to