[Tinyos-commits] CVS: tinyos-1.x/tos/platform/telos HumidityM.nc,
1.5, 1.6
Joe Polastre
jpolastre at users.sourceforge.net
Mon Jun 20 08:52:26 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tos/platform/telos
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25169
Modified Files:
HumidityM.nc
Log Message:
fix for those still using nesc 1.1.* that doesn't allow 'return' in
atomic block. argh!
also, nesc 1.1.2b produces a different set of atomic warnings than
nesc 1.2alpha10. why????
Index: HumidityM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/platform/telos/HumidityM.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** HumidityM.nc 18 Jun 2005 01:12:59 -0000 1.5
--- HumidityM.nc 20 Jun 2005 15:52:24 -0000 1.6
***************
*** 135,138 ****
--- 135,139 ----
event result_t Timer.fired() {
+ uint8_t _state = IDLE;
atomic {
if (state == WARM_UP) {
***************
*** 142,151 ****
else if (state == SAMPLE) {
if (id == HUMIDITY) {
! return call HumSensor.getData();
}
else if (id == HUMIDITY_TEMP)
! return call TempSensor.getData();
}
}
return SUCCESS;
}
--- 143,157 ----
else if (state == SAMPLE) {
if (id == HUMIDITY) {
! _state = HUMIDITY;
}
else if (id == HUMIDITY_TEMP)
! _state = HUMIDITY_TEMP;
}
}
+
+ if (_state == HUMIDITY)
+ return call HumSensor.getData();
+ else if (_state == HUMIDITY_TEMP)
+ return call TempSensor.getData();
return SUCCESS;
}
More information about the Tinyos-commits
mailing list