XC8 (also HI-TECH compilers PICC, PICC18-STD, PIC18-PRO, dsPIC®, PIC32)
The XC8 toolchain is the upgrade for the PICC and PICC18 toolchains.
The required macro for these toolchains is MP_PROCESSOR_OPTION. MP_PROCESSOR_OPTION will be different for each of these compilers. If you take the “MPLAB®X” name, you can derive the “compiler” name using the following Java code:
public static String getProcessorNameForCompiler(String deviceName) { String res = deviceName; String lowerCaseDeviceName = deviceName.toLowerCase(); if (lowerCaseDeviceName.startsWith("pic")) res = deviceName.substring(3); else if (lowerCaseDeviceName.startsWith("rfpic")) res = deviceName.substring(5); else if (lowerCaseDeviceName.startsWith("dspic")) res = deviceName.substring(5); return res; }
Here the deviceName is the “MPLABX” name.
The optional macros for these toolchains are:
- MP_EXTRA_CC_PRE
- MP_EXTRA_AS_PRE
- MP_EXTRA_LD_PRE (for a stand alone project)
These toolchains do not support library projects.