[Tinyos-help] Bug in /tos/sensorboards/mts300/PhotoTempControlP.nc ?

David Gay dgay42 at gmail.com
Mon May 21 15:12:50 PDT 2007


On 5/18/07, Hugo Sousa <hcsousa at gmail.com> wrote:
> 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.

Hmm, indeed there was various forms of brokenness in the photo/temp
sensors on the mts300. I've written a fix, it will be committed when I
can test it.

> 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

That call to SplitControl.stop should not have been in readDone (and
won't work right anyway).As it currently stands, all those requests
would complete in 20ms, but only the first one would work ;-)


David


More information about the Tinyos-help mailing list