Professional Documents
Culture Documents
//end if
//if the driving through stage timer has expired, and we are through a staging area
that is not the target
//enable the input capture interrupt on rising edges (disabled in ISR
after posting ES_PERIOD_SAMPLED)
//if we've found the target staging area
//switch states to the checking in state
//enable the input capture interrupt and start recording the staging area
period
//end if
//if we're currently checking in to a staging area
//if we just captured enough edges to bin
//If the average period found in ISR can be fit in a bin
//enable the input capture interrupt on rising edges, to compute the
staging area period
//if ES_STAGING_AREA_OPEN is posted from GameplaySM (i.e successful check in
completed)
//if we've opened a staging area successfully
//We want to return to the idle state and wait for another ES_FIND_STAGE
command
//return to the idle state
//disable the input capture interrupt
//initialize the after checking-in debounce timer, during which the
interrupt will be disabled
//we just checked in, so we don't want to trigger another check-in until
we've driven off the stage
//set LastHallPeriodBin = 0;
//set HallPeriodBin = 0;
//set LastBinnedCode = 0;
//set EdgesCounter = 0;
}
//if we just checked into an inactive staging area and updated our location
//We want to return to the idle state and wait for another ES_FIND_STAGE
command
//return to the idle state
//disable the input capture interrupt
//initialize the after checking-in debounce timer, during which the
interrupt will be disabled
//we just checked in, so we don't want to trigger another check-in until
we've driven off the stage
//set LastHallPeriodBin = 0;
//set HallPeriodBin = 0;
//set LastBinnedCode = 0;
//set EdgesCounter = 0;
}
//end if
}