I started with EasyC, and then moved to MPLab using EasyC libraries. Now I am trying to get the same functionality by making the necessary changes to the VexCode source (user_routines.[ch] and user_routines_fast.c). I am trying to count clicks of the shaft encoder using an interrupt and I've been analyzing the user_routines_sensor_test_fast.c code as an example. The comment at the top that "Encoder not ready yet" had me worried but I saw a lot of code associated with it so I read on

With few comments in the code associated with the encoder, its tough for a beginner to work out the behavior. VexLabs makes it clear that they don't support the code so I thought I would ask and see if anyone here can lend some guidance.
Has anyone here used this example successfuly? Would you mind explaining how the encoder interrupt handler works with the timer2 interrupt handler?
Does anyone have another (possibly clearer) example they would like to share?
Can someone explain why they would make this assignment:
rc_dig_out11 ^= 1; rather than rc_dig_out11 = 1; ?
Its a digital output so would there be a difference?
I see quite a few uninitialized variables. EncoderDataTickCounter is an example. It is declared and incremented but never initialized. Must not be an issue for some reason.
In the interrupt handler, EncoderDataFlag.bit1 is set but I don't see anywhere that it is cleared. The comment says it indicates that data is ready to be read.
I will keep working on the problem and report back if I have anything useful for others in the same situation.
Thanks for your time,
-Glenn