[Tinyos-help] Bug in /tos/sensorboards/mts300/PhotoTempControlP.nc ?
Hugo Sousa
hcsousa at gmail.com
Fri May 18 09:38:29 PDT 2007
In PhotoTempDeviceC there are two instances of PhotoTempControlP wired to
the same warmup timer. When the timer fires, both instances signal their own
instance of SplitControlPowerManagerC, but only the one that got the
resource from the sharing arbiter is supposed to to that, since it should
have only called the timer after having the resource granted. "Simultaneous"
reads of the Temp and Photo sensor will corrupt the second reader (because
the first reader had set the pins). In my case I just used a "tflag"
variable (similar purpose to rflag) to solve the problem.
When readDone is signaled there are PhotoTempResource.release() and
SplitControl.stop() calls. Maybe this is only an architectural choice to
allow alternate access to the sensors, but in case there are N PhotoC()s and
M TempC()s and all of them decide to read at the same time, the total time
from the first read to the last readDone will be 10ms * (N+M); if the
sharing resource is kept to service all the PhotoCs and then all the TempCs,
the time will be 20ms
Regards,
Hugo S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070518/9bb5eb86/attachment.html
More information about the Tinyos-help
mailing list