|
From: Lin Gu <li...@us...> - 2004-12-15 22:15:26
|
Update of /cvsroot/vert/vert-1.3/apps/xsm3.mag.sownclassification In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16562/apps/xsm3.mag.sownclassification Modified Files: MagClassifyM.nc Makefile TestMag.nc TestMagM.nc Log Message: commit after returning from Avon Park, FL. Index: MagClassifyM.nc =================================================================== RCS file: /cvsroot/vert/vert-1.3/apps/xsm3.mag.sownclassification/MagClassifyM.nc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MagClassifyM.nc 4 Dec 2004 00:54:03 -0000 1.7 --- MagClassifyM.nc 15 Dec 2004 22:15:17 -0000 1.8 *************** *** 247,250 **** --- 247,251 ---- #include "common.h" + uint8_t cNumStarted, cSleeping; TargetConfidence gtcTarget; uint8_t state, nPotX, nPotY;; *************** *** 801,805 **** atomic { state = MAG_GENESIS; ! call MagControl.init(); --- 802,806 ---- atomic { state = MAG_GENESIS; ! cNumStarted = cSleeping = 0; call MagControl.init(); *************** *** 921,925 **** if (l_state == MAGSENSE) { ! atomic state = MAG_WAKEUP; } else --- 922,929 ---- if (l_state == MAGSENSE) { ! atomic { ! state = MAG_WAKEUP; ! cSleeping = 0; ! } // atomic } else *************** *** 950,953 **** --- 954,969 ---- return FAIL; } + + if (cNumStarted > 0) + { + if (!cSleeping) + { + return SUCCESS; + } // if + } // if + else + { + cNumStarted++; + } // else if (l_state == MAG_GENESIS) *************** *** 990,993 **** --- 1006,1010 ---- void doStopSensor() { + cSleeping = 1; call Timer.stop(); call MagControl.stop(); Index: TestMag.nc =================================================================== RCS file: /cvsroot/vert/vert-1.3/apps/xsm3.mag.sownclassification/TestMag.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestMag.nc 4 Dec 2004 00:54:04 -0000 1.2 --- TestMag.nc 15 Dec 2004 22:15:17 -0000 1.3 *************** *** 35,38 **** --- 35,39 ---- TestMagM.ClassifiedSensing -> MagClassify; TestMagM.Timer -> TimerC.Timer[unique("Timer")]; + TestMagM.Timer1 -> TimerC.Timer[unique("Timer")]; TestMagM.CollaborativeSensing -> MagClassify; } Index: Makefile =================================================================== RCS file: /cvsroot/vert/vert-1.3/apps/xsm3.mag.sownclassification/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 4 Dec 2004 00:54:04 -0000 1.6 --- Makefile 15 Dec 2004 22:15:17 -0000 1.7 *************** *** 1,4 **** COMPONENT=TestMag ! PFLAGS := -DSHOW_PHASEno -DLIN_DEBUGno -DMAG_INDICATE_REPORTno -DPRINT_REPORT -DMAG_USE_SOUNDERno -DPLATFORM_XSM_X -DPLATFORM_XSM -DDUMP_MAG_DATAno -DCLASSIFY_VEHICLE $(PFLAGS) # SENSORBOARD=echelon #TINYOS_NP = TKER --- 1,4 ---- COMPONENT=TestMag ! PFLAGS := -DSHOW_PHASEno -DLIN_DEBUG -DMAG_INDICATE_REPORTno -DPRINT_REPORT -DMAG_USE_SOUNDERno -DPLATFORM_XSM_X -DPLATFORM_XSM -DDUMP_MAG_DATAno -DCLASSIFY_VEHICLE $(PFLAGS) # SENSORBOARD=echelon #TINYOS_NP = TKER Index: TestMagM.nc =================================================================== RCS file: /cvsroot/vert/vert-1.3/apps/xsm3.mag.sownclassification/TestMagM.nc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestMagM.nc 4 Dec 2004 00:54:04 -0000 1.5 --- TestMagM.nc 15 Dec 2004 22:15:17 -0000 1.6 *************** *** 34,37 **** --- 34,38 ---- interface ClassifiedSensing; interface Timer; + interface Timer as Timer1; #ifdef USE_PEEK interface StdControl as PeekControl; *************** *** 52,55 **** --- 53,57 ---- int nFA; long lTick; + int second; command result_t StdControl.init() { *************** *** 110,113 **** --- 112,117 ---- if (confidence[1] >= 30) { + call Timer1.start(TIMER_ONE_SHOT, 50); + #define DETECT_FALSE_ALARMno #ifdef DETECT_FALSE_ALARM *************** *** 136,139 **** --- 140,151 ---- return SUCCESS; } + event result_t Timer1.fired() + { + if (second) return SUCCESS; + second = 1; + call ClassifiedSensing.enableSensor(); + call MagClassify.start(); + return SUCCESS; + } event result_t Timer.fired() *************** *** 171,175 **** #ifdef TEST_WAKE_UP ! if (lTick == 22) { call MagClassify.stop(); --- 183,187 ---- #ifdef TEST_WAKE_UP ! if (lTick == 33) { call MagClassify.stop(); *************** *** 178,182 **** } ! if (lTick == 25) { #ifdef USE_PEEK --- 190,194 ---- } ! if (lTick == 34) { #ifdef USE_PEEK *************** *** 189,193 **** ! if (lTick == 35) { #ifdef USE_PEEK --- 201,205 ---- ! if (lTick == 38) { #ifdef USE_PEEK *************** *** 234,241 **** } ! if (lTick == 90) { #ifdef USE_PEEK ! call Peek.print4Int(0xa,0xa,3,3); #endif call MagClassify.start(); --- 246,253 ---- } ! if (lTick == 105) { #ifdef USE_PEEK ! // call Peek.print4Int(0xa,0xa,3,3); #endif call MagClassify.start(); |