Why are some of my variables shown as not used?
The MPLAB® XC compiler running in Pro mode may determine that some of the variables are never used. These variables will be removed from the program. This means they will not take up memory, not appear in the assembly list or map files, and they will not appear in the Watch view.
Variables that are used, but only in a trivial fashion may also be shown as unused. For example, you may assign a value to them, but not read the value later. If there is no functional effect of using the variable, it may be removed.
If you want the variable to remain, despite the fact that it is not used, qualify it as volatile for debug builds.