Target Control Pseudo Code
The Target Control service checks for target events and contains helper functions to turn targets on and off
InitTargetControl
Initialize pins for mux's and sensor
Set the PWM Period for Group 0 to 2 ms
Set the current show state to BlinkOn
post the initial transition event
RunTargetControl
if ThisEvent is a target pulse timeout
Post a Target Uncovered Event
if ThisEvent is a target show timeout
Continue to next target in show
if ThisEvent is a end show timeout
Continue to next target in show
if ThisEvent is a blink timeout
Continue to next target in show
CheckForTargetCovered
if pin state has changed
if it is a falling edge
start timer with length > period
post event TargetCovered
Set last pin state to current pin state
Initialize pins for mux's and sensor
Set the PWM Period for Group 0 to 2 ms
Set the current show state to BlinkOn
post the initial transition event
RunTargetControl
if ThisEvent is a target pulse timeout
Post a Target Uncovered Event
if ThisEvent is a target show timeout
Continue to next target in show
if ThisEvent is a end show timeout
Continue to next target in show
if ThisEvent is a blink timeout
Continue to next target in show
CheckForTargetCovered
if pin state has changed
if it is a falling edge
start timer with length > period
post event TargetCovered
Set last pin state to current pin state