]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Replace a cardinal value with its proper template argument in WindVaneP.
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Wed, 4 Nov 2009 19:17:56 +0000 (19:17 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 03:01:46 +0000 (20:01 -0700)
The wind vane infrastructure works with 128 sectors, the max, which offers
approximately a 3 degree resolution.  This comes at the cost of an additional
129 bytes of RAM over using 32 sectors.

tos/platforms/tmirws/sensors/WindVaneP.nc

index ef1543c42d9f4ff8b2086f1843ff453a3b79b832..65716f63f7718ccf800c50f043ded67591f150c8 100644 (file)
@@ -72,7 +72,7 @@ implementation {
   /* Convert a degree heading into a sector */
   uint16_t degreeToSector(uint16_t degree)
   {
-    return ((degree * sectors + 180) / 360) % 32;
+    return ((degree * sectors + 180) / 360) % sectors;
   }
 
   /* Return the # of sectors clockwise along the compass from start to end.  */