1 temp = calculateCentroids(wVCentroid, wVCentroidSize, MAX_NUM_CENTROIDS, FIRST_SENSOR_V, LAST_SENSOR_V, numSensors);
2 firstActiveSensor = temp & 0xFF;
3 lastActiveSensor = temp >> 8;
4 bActivityDetected = lastActiveSensor >= 0;
6 temp = lastActiveSensor - (LAST_SENSOR_V - FIRST_SENSOR_V );
10 if(lastActiveSensor >= LAST_SENSOR_V - FIRST_SENSOR_V
11 && (((BYTE)temp) << SLIDER_BITS) >= wVCentroid[0] )
14 for(counter = MAX_NUM_CENTROIDS - 1; counter >= 1; counter--) {
15 if(0xFFFF == wVCentroid[counter])
18 wVCentroidSize[0] = wVCentroidSize[counter];
19 wVCentroid[0] = wVCentroid[counter];
21 if(wVCentroid[0] >= posEndOfLoop)
22 wVCentroid[0] -= posEndOfLoop;
24 wVCentroid[counter] = 0xFFFF;
25 wVCentroidSize[counter] = 0x0;