I am reviewing the Firmware Framework code to see where I need to make changes for my own application and I came across this code inside gesture.c which does not make sense to me...
void runGesture(int pixels[], GestureResult *gesResult)
{
// Initialize result structure
memset(gesResult, 0, sizeof(GestureResult));
gesResult->state = STATE_INACTIVE;
gesResult->gesture = GEST_NONE;
// Noise filter
if (gestCfg.enable_window_filter) {
noiseWindow3Filter(pixels, gestCfg.window_filter_alpha, reset_flag);
}
// Process pixels for dynamic gesture
if (1) {
DynamicGestureResult dynamicResult;
runDynamicGesture(&gestCfg, pixels, &dynamicResult);
gesResult->state = dynamicResult.state;
gesResult->n_sample = dynamicResult.n_sample;
gesResult->maxpixel = dynamicResult.maxpixel;
gesResult->x = dynamicResult.x;
gesResult->y = dynamicResult.y;
}
// Process pixels for tracking
if (0) {
TrackingResult trackResult;
runTracking(&gestCfg.trackingConfig, pixels, &trackResult);
gesResult->state = trackResult.state;
gesResult->maxpixel = trackResult.maxpixel; // Will override dynamic result if any
gesResult->x = trackResult.x; // Will override dynamic result if any
gesResult->y = trackResult.y; // Will override dynamic result if any
}
}
How do these conditions get met...
// Process pixels for dynamic gestureif (1) { ..... }
// Process pixels for trackingif (0) { ..... }
Now wondering what it should read... any idea?
