X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FWindVaneP.nc;h=8557c8cc2eba34b6352544fe9e12c8a5805a8b1a;hp=8ec74fc5ac7ad98c8e5b6ea9a158eb3f5cd35f47;hb=2b13e010fe9542bbca8287949880cef3112a94a3;hpb=5df339a9fd5bb6d49a898d1f6db8fc11e229858a diff --git a/tos/platforms/tmirws/sensors/WindVaneP.nc b/tos/platforms/tmirws/sensors/WindVaneP.nc index 8ec74fc5..8557c8cc 100644 --- a/tos/platforms/tmirws/sensors/WindVaneP.nc +++ b/tos/platforms/tmirws/sensors/WindVaneP.nc @@ -49,7 +49,7 @@ generic module WindVaneP(uint8_t sectors) { } } implementation { - uint16_t m_compass[sectors]; + uint8_t m_compass[sectors]; bool m_overflow; wind_vane_t* m_data; @@ -69,7 +69,7 @@ implementation { } /* Convert a degree heading into a sector */ - uint16_t degreeToSector(uint16_t degree) + uint8_t degreeToSector(uint16_t degree) { return ((degree * sectors + 180) / 360) % sectors; } @@ -83,7 +83,7 @@ implementation { /* circularly examine compass, starting with pos + 1, for the next compass * position having a value of zero. */ - uint8_t nextNonZero(uint16_t* compass, uint8_t pos) + uint8_t nextNonZero(uint8_t* compass, uint8_t pos) { do { pos = (pos + 1) % sectors; @@ -91,7 +91,7 @@ implementation { return pos; } - bool isCompassEmpty(uint16_t* compass) + bool isCompassEmpty(uint8_t* compass) { int i; @@ -105,7 +105,7 @@ implementation { /* Reduce all compass headings equally until a compass heading has a value * of zero. */ - void minimizeCompass(uint16_t* compass) + void minimizeCompass(uint8_t* compass) { uint8_t min = 255; int i; @@ -124,7 +124,7 @@ implementation { * that arc in m_data's left and right fields. The compass arc is always * defined clockwise, from left to right. */ - void findArc(uint16_t* compass) + void findArc(uint8_t* compass) { uint8_t begin; uint8_t save = 255; @@ -146,7 +146,7 @@ implementation { m_data->left = (save + dist) % sectors; } - void calcAvg(uint16_t* compass) + void calcAvg(uint8_t* compass) { /* Find the average compass heading */ uint32_t sum = 0; @@ -208,7 +208,7 @@ implementation { task void readCompass() { bool overflow; - uint16_t compass[sectors]; + uint8_t compass[sectors]; wind_vane_t* data = m_data; atomic {