I'm not sure if this is standard C or not.  I'm pretty sure it is but don't
want to go find it in the reference.

10L means make it a long.    10UL would make it an unsigned long.

Basicaly 1024 * 10L is doing 32 bit signed arithmetic.   The code really
should be 1024 * 10UL because time is never negative.  In this case it is
acutally a delta time.

from Timer.nc:

  command void startPeriodic(uint32_t dt);


I don't know how to find this in google.   I'm sure there is a way.   Well I
just went and figured that out too.   God I'm easy to distract :-)

I searched for "integer constants c"    As I was typing it google even
helped with suggestions.  Just saying that's what it did not giving you a
hard time or anything.   Before I went and found the stuff in H&S (see
below), I had no clue as to what to search for.  I had already found the
reference in the book I mention below so already knew what to search for.
 (you know I cheated :-).


A better way to find this find this kind of stuff is to pick up a good C
reference (reference, not an introduction or tutorial) and scan through it.
  Like right before you go to bed (if you have trouble sleeping) :-)   just
kidding.   But seriously it will be in there.  My favorite is Harbison and
Steele.

Oh bother.   I broke down and took the book off the book shelf :-)  Page 25
of the 4th edition.  Integer Constants.  It is an integer-suffix which can
be one of LU or UL.

eric


On Mon, Jul 25, 2011 at 8:42 AM, [email protected]
<[email protected]>wrote:

> Hi,
>
> An easy question:
>
> What the 'L' stands for when assigning the period to a timer? for example
>
> call MyTimer.startPeriodic(1024 * 10L);
>
> it starts a periodic timer that fires every 10 seconds but what's the
> meaning of 'L'
>
> I couldn't find it in google...
>
> thanks
>
> Davide
> _______________________________________________
> 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