How do I correct PICC “fixup” errors ?
Q. How to correct PICC “fixup” errors ? A. This FAQ assumes that you have located the code that caused the fixup error. You can find information on how to locate the cause of a fixup error in the FAQ titled: “How do I locate “Fixup error” messages?”. Fixup errors usually occur on the PICC compiler when converting between different bank pointer types. On most occasions this occurs when passing a bank pointer to a function that accepts a different bank pointer or assigning a bank pointer to a different bank pointer. To fix the error you will need to change the declaration of the function or pointer to accept the correct pointer type. Note that a ‘const’ pointer can access all banks but it can not be written to. Also, on the PIC midrange chips, bank 0 pointers can point to bank 1 without a fixup error and visa versa. Bank 2 pointers can point to bank 3 pointers without a fixup error and visa versa. But bank 0 or 1 pointers can’t point to bank 2 or 3. Below is an example pointer assignment