Thread: [Firebug-cvs] fireboard/fireboard/sensors/taos_tsl250rd TaosPhotoM.nc,1.1.1.1,1.2 taosM.nc,1.1.1.1,1
Brought to you by:
doolin
From: <do...@pr...> - 2004-01-22 22:00:20
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27743 Modified Files: TaosPhotoM.nc taosM.nc Log Message: Sampling interval is now set and sampling started from the test application. Sampling intervals of 500 ms appear to be too fast for the device to respond, so default is set to 2000 ms, and the app was tested at 2500 and 4000 ms. Index: TaosPhotoM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/TaosPhotoM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TaosPhotoM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- TaosPhotoM.nc 22 Jan 2004 21:59:05 -0000 1.2 *************** *** 90,94 **** #include "SODebug.h" ! #define DBG_USR2 0 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, --- 90,94 ---- #include "SODebug.h" ! #define DBG_USR2 0 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, *************** *** 102,106 **** task void DataReady_0() { ! SODbg(DBG_USR2, "TaosPhoto:Ch0:, %i \n", (uint16_t)data_adc); signal ADC.dataReady[0](data_adc); return; --- 102,106 ---- task void DataReady_0() { ! SODbg(DBG_USR2, "TaosPhotoM.DataReady_0:, %i \r\n", (uint16_t)data_adc); signal ADC.dataReady[0](data_adc); return; *************** *** 108,112 **** task void DataReady_1(){ ! SODbg(DBG_USR2, "TaosPhoto:Ch1:, %i \n", (uint16_t)data_adc); signal ADC.dataReady[1](data_adc); return; --- 108,112 ---- task void DataReady_1(){ ! SODbg(DBG_USR2, "TaosPhotoM.DataReady_1:, %i \r\n", (uint16_t)data_adc); signal ADC.dataReady[1](data_adc); return; *************** *** 122,126 **** } ! SODbg(DBG_USR2, "TaosPhoto:init \n"); call I2CPacketControl.init(); --- 122,126 ---- } ! SODbg(DBG_USR2, "TaosPhotoM.SplitControl.init \r\n"); call I2CPacketControl.init(); *************** *** 138,142 **** command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhoto:start \n"); atomic { --- 138,142 ---- command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start \r\n"); atomic { *************** *** 146,149 **** --- 146,150 ---- call SwitchControl.start(); if (call Switch.set(MICAWB_LIGHT_POWER,1) != SUCCESS) { + SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start SWITCH_WAIT set\r\n"); state = SWITCH_WAIT; } *************** *** 217,221 **** async command result_t ADC.getData[uint8_t id]() { ! SODbg(DBG_USR2, "TaosPhoto:getData \n"); if (state == IDLE) { --- 218,222 ---- async command result_t ADC.getData[uint8_t id]() { ! SODbg(DBG_USR2, "TaosPhotoM.ADC.getData \r\n"); if (state == IDLE) { *************** *** 297,300 **** --- 298,302 ---- event result_t Timer.fired() { + SODbg(DBG_USR2, "TaosPhotoM.Timer.fired() \r\n"); atomic { state = IDLE; Index: taosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taosM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** taosM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- taosM.nc 22 Jan 2004 21:59:22 -0000 1.2 *************** *** 40,47 **** #define DBG_USR2 0 - enum {START, BUSY, LIGHT_DONE, ACCEL_DONE}; - uint16_t TaosData; ! uint8_t state; taos_tsl250rd_data_msg data_msg = {0}; --- 40,45 ---- #define DBG_USR2 0 uint16_t TaosData; ! uint16_t sampling_interval = 2000; taos_tsl250rd_data_msg data_msg = {0}; *************** *** 60,69 **** command result_t StdControl.start() { - - call Leds.redOn(); - call Leds.yellowOn(); - call Leds.greenOn(); - state = START; - //call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } --- 58,61 ---- *************** *** 75,98 **** event result_t Timer.fired() { ! call Leds.redOff(); ! call Leds.yellowOff(); ! call Leds.greenOff(); ! ! switch (state) { ! ! case START: ! state = BUSY; ! call TaosControl.start(); ! break; ! ! case LIGHT_DONE: ! state = START; ! break; ! ! default: ! break; ! } ! ! return SUCCESS; } --- 67,72 ---- event result_t Timer.fired() { ! SODbg(DBG_USR2, "taosM.Timer.fired() \r\n") ; ! call TaosControl.start(); return SUCCESS; } *************** *** 202,206 **** event result_t TaosControl.stopDone() { - state = LIGHT_DONE; signal Sensor.powerOffDone(); return SUCCESS; --- 176,179 ---- *************** *** 233,237 **** } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } --- 206,214 ---- } ! command result_t Sensor.setSamplingInterval(uint16_t interval) { ! ! atomic { ! sampling_interval = interval; ! } return SUCCESS; } *************** *** 242,245 **** --- 219,224 ---- command result_t Sensor.startSampling() { + SODbg(DBG_USR2, "taosM.Sensor.startSampling() \r\n") ; + call Timer.start(TIMER_REPEAT, sampling_interval); return SUCCESS; } *************** *** 257,261 **** } ! default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 236,240 ---- } ! default async event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } |