[Firebug-cvs] fireboard/fireboard/sensors/sensirion_sht11 Sensirion.nc,1.2,1.3 SensirionHumidity.nc,
Brought to you by:
doolin
Update of /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/sensirion_sht11 Modified Files: Sensirion.nc SensirionHumidity.nc SensirionHumidityM.nc SensirionM.nc TempHum.nc TempHumM.nc sensirion_sht11.h Log Message: Changed to HLSensor. Index: Sensirion.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/Sensirion.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sensirion.nc 6 Jan 2004 16:29:47 -0000 1.2 --- Sensirion.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - --- 1,2 ---- *************** *** 94,98 **** provides interface StdControl; ! provides interface Sensor; } --- 91,95 ---- provides interface StdControl; ! provides interface HLSensor; } *************** *** 107,111 **** SensirionM.StdControl = StdControl; ! Sensor = SensirionM; StdControl = TimerC; --- 104,108 ---- SensirionM.StdControl = StdControl; ! HLSensor = SensirionM; StdControl = TimerC; Index: sensirion_sht11.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/sensirion_sht11.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sensirion_sht11.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- sensirion_sht11.h 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 1,3 **** --- 1,5 ---- + #ifndef SENSIRION_SHT11_H + #define SENSIRION_SHT11_H /** *************** *** 13,16 **** --- 15,20 ---- + const uint8_t SENSIRION_POWER_ON = 1; + typedef struct _sht11data { *************** *** 20,21 **** --- 24,27 ---- float rel_hum; } sht11data_msg; + + #endif /* SENSIRION_SHT11_H */ Index: SensirionHumidity.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionHumidity.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SensirionHumidity.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- SensirionHumidity.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 5,9 **** * Authors: Joe Polastre * - * $Id$ */ --- 5,8 ---- Index: TempHum.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/TempHum.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TempHum.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- TempHum.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 63,67 **** * Authors: Mohammad Rahmim, Joe Polastre * - * $Id$ */ --- 63,66 ---- Index: TempHumM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/TempHumM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TempHumM.nc 21 Jan 2004 20:42:35 -0000 1.2 --- TempHumM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* --- 1,3 ---- ! /* *************** *** 65,69 **** * Authors: Mohammad Rahmim, Joe Polastre * - * $Id$ */ --- 65,68 ---- *************** *** 212,216 **** if(HUMIDITY_GET_DATA()) { //if SDA hi then Sensirion is not responding ! SODbg(DBG_USR2, "TempHumM.processCommand: No response from Sensirion \n"); reset(); --- 211,215 ---- if(HUMIDITY_GET_DATA()) { //if SDA hi then Sensirion is not responding ! SODbg(DBG_USR2, "TempHumM.processCommand: No response from Sensirion \n"); reset(); *************** *** 233,237 **** if ((CMD == TOSH_HUMIDITY_ADDR) && (humerror == TRUE)) { ! SODbg(DBG_USR2, "TempHumM.processCommand: cmd complete, starting timer for measurement \n"); atomic { --- 232,236 ---- if ((CMD == TOSH_HUMIDITY_ADDR) && (humerror == TRUE)) { ! SODbg(DBG_USR2, "TempHumM.processCommand: cmd complete, starting timer for measurement \n"); atomic { *************** *** 394,402 **** ! /****************************************************************************** * TOSH_SIGNAL(HUMIDITY_INTERRUPT) * -Enter here when Sensirion completes measurement * -Sensirion SDA line goes low when it completes measurement ! ******************************************************************************/ // #ifndef PLATFORM_PC TOSH_SIGNAL(HUMIDITY_INTERRUPT) { --- 393,401 ---- ! /****************************************************************************** * TOSH_SIGNAL(HUMIDITY_INTERRUPT) * -Enter here when Sensirion completes measurement * -Sensirion SDA line goes low when it completes measurement ! ******************************************************************************/ // #ifndef PLATFORM_PC TOSH_SIGNAL(HUMIDITY_INTERRUPT) { *************** *** 413,417 **** HUMIDITY_INT_DISABLE(); ! SODbg(DBG_USR2, "TempHumM.TOSH_SIGNAL(HUMIDITY INTERRUPT): measurment complete \n"); call Leds.redOff(); call Leds.yellowOff(); --- 412,416 ---- HUMIDITY_INT_DISABLE(); ! SODbg(DBG_USR2, "TempHumM.TOSH_SIGNAL(HUMIDITY INTERRUPT): measurment complete \n"); call Leds.redOff(); call Leds.yellowOff(); *************** *** 460,464 **** } ! SODbg(DBG_USR2, "TempHumM.getData: starting to get humidity data \n"); //call Leds.yellowOn(); atomic { --- 459,463 ---- } ! SODbg(DBG_USR2, "TempHumM.getData: starting to get humidity data \n"); //call Leds.yellowOn(); atomic { Index: SensirionHumidityM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionHumidityM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SensirionHumidityM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- SensirionHumidityM.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,3 ---- ! *************** *** 6,10 **** * Authors: Joe Polastre * - * $Id$ */ --- 6,9 ---- *************** *** 172,176 **** if (id == MICAWB_HUMIDITY) { ! SODbg(DBG_USR2, "SensirionHumidityM.Timer.fired: get humidity data \n"); return call HumSensor.getData(); --- 171,175 ---- if (id == MICAWB_HUMIDITY) { ! SODbg(DBG_USR2, "SensirionHumidityM.Timer.fired: get humidity data \n"); return call HumSensor.getData(); *************** *** 251,255 **** } ! /****************************************************************************** * HumSensor.dataReady * -Data ready from humidity sensor --- 250,254 ---- } ! /****************************************************************************** * HumSensor.dataReady * -Data ready from humidity sensor *************** *** 258,262 **** async event result_t HumSensor.dataReady(uint16_t data) { ! SODbg(DBG_USR2, "SensirionHumidityM.HumSensor.dataReady: data ready \n"); atomic { --- 257,261 ---- async event result_t HumSensor.dataReady(uint16_t data) { ! //SODbg(DBG_USR2, "SensirionHumidityM.HumSensor.dataReady: data ready \n"); atomic { Index: SensirionM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SensirionM.nc 21 Jan 2004 20:42:35 -0000 1.2 --- SensirionM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,4 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - /****************************************************************************** --- 1,2 ---- *************** *** 34,38 **** interface StdControl; ! interface Sensor; } --- 32,36 ---- interface StdControl; ! interface HLSensor; } *************** *** 108,111 **** --- 106,113 ---- + task void sensorDataready() { + + signal HLSensor.dataReady(&data_msg); + } *************** *** 139,143 **** } ! signal Sensor.dataReady(&data_msg); fTemp = 10*fTemp; --- 141,147 ---- } ! signal HLSensor.dataReady(&data_msg); ! ! //post sensorDataready(); fTemp = 10*fTemp; *************** *** 146,150 **** //call TempHumControl.stop(); ! //call Sensor.powerOff(); return SUCCESS; --- 150,154 ---- //call TempHumControl.stop(); ! //call HLSensor.powerOff(); return SUCCESS; *************** *** 189,193 **** /////////////////////////////////////////////////////////// ! command result_t Sensor.powerOn() { call StdControl.start(); --- 193,197 ---- /////////////////////////////////////////////////////////// ! command result_t HLSensor.powerOn(uint8_t power_level) { call StdControl.start(); *************** *** 196,204 **** } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.init() { //call StdControl.init(); --- 200,208 ---- } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.init() { //call StdControl.init(); *************** *** 207,211 **** } ! command result_t Sensor.powerOff() { SODbg(DBG_USR2, "SensirionM.Sensor.powerOff()...\n"); --- 211,215 ---- } ! command result_t HLSensor.powerOff() { SODbg(DBG_USR2, "SensirionM.Sensor.powerOff()...\n"); *************** *** 214,233 **** call TempHumControl.stop(); } ! signal Sensor.powerOffDone(); return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { call Timer.start(TIMER_REPEAT, 2000); --- 218,237 ---- call TempHumControl.stop(); } ! signal HLSensor.powerOffDone(); return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } ! command result_t HLSensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { call Timer.start(TIMER_REPEAT, 2000); *************** *** 235,255 **** } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t Sensor.error(uint16_t) { return SUCCESS; } ! command result_t Sensor.loadProgram(uint8_t * program) { return SUCCESS; } --- 239,259 ---- } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t HLSensor.error(uint16_t) { return SUCCESS; } ! command result_t HLSensor.loadProgram(uint8_t * program,uint8_t length) { return SUCCESS; } |