These are the settings I use in Microsoft Visual Studio however they should work to allow other compilers to process the Particle header files.
There are two major sections, one for the Photon and one for the Electron.
In those, you can find incudePaths. Note that you not only need the firmware repository, but also the gcc-arm 5.3.1 header files!
In defines are the various defines that you probably need to compile. Not all of them are probably necessary, but that’s what’s defined for a build on that platform in a real build.
Finally, compilerSwitches. These might not be necessary for a linter-type compiler, except maybe enabling C++11.
{
"configurations":[
{
"name":"Particle photon",
"includePath":[
"${workspaceRoot}\\..\\firmware\\communication\\src",
"${workspaceRoot}\\..\\firmware\\dynalib\\inc",
"${workspaceRoot}\\..\\firmware\\hal\\inc",
"${workspaceRoot}\\..\\firmware\\hal\\shared",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\api",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\include",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\libraries\\crypto",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\WWD\\include\\",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\platform\\GCC\\",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\platform\\include\\",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\security\\BESL",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\security\\BESL\\crypto",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\security\\BESL\\host\\WICED\\",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\security\\BESL\\include",
"${workspaceRoot}\\..\\firmware\\hal\\src\\photon\\wiced\\security\\BESL\\supplicant\\",
"${workspaceRoot}\\..\\firmware\\hal\\src\\stm32",
"${workspaceRoot}\\..\\firmware\\hal\\src\\stm32f2xx",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\CMSIS\\Device\\ST\\Include",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\CMSIS\\Include",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\SPARK_Firmware_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_StdPeriph_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_Device_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_Host_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_OTG_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\shared\\STM32\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\shared\\inc",
"${workspaceRoot}\\..\\firmware\\services\\inc",
"${workspaceRoot}\\..\\firmware\\system\\inc",
"${workspaceRoot}\\..\\firmware\\user\\inc",
"${workspaceRoot}\\..\\firmware\\wiring\\inc",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\arm-none-eabi",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\arm-none-eabi\thumb",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\ext",
"${workspaceRoot}\\..\\gcc-arm\\lib\\gcc\\arm-none-eabi\\5.3.1\\include",
"${workspaceRoot}\\src"
],
"defines":[
"BOOTLOADER_SDK_3_3_0_PARTICLE",
"DFU_BUILD_ENABLE",
"INCLUDE_PLATFORM=1",
"LOG_INCLUDE_SOURCE_INFO=1",
"LOG_MODULE_CATEGORY=\"\\\"app\\\"\"",
"MODULAR_FIRMWARE=1",
"MODULE_DEPENDENCY2=0,0,0",
"MODULE_DEPENDENCY=4,2,207",
"MODULE_FUNCTION=5",
"MODULE_INDEX=1",
"MODULE_VERSION=5",
"PARTICLE=1",
"PARTICLE_DCT_COMPATIBILITY",
"PARTICLE_USER_MODULE",
"PLATFORM_ID=6",
"PLATFORM_NAME=photon",
"PLATFORM_THREADING=1",
"PRODUCT_FIRMWARE_VERSION=65535",
"PRODUCT_ID=6",
"RELEASE_BUILD",
"SPARK=1",
"SPARK_PLATFORM",
"SPARK_PLATFORM_NET=BCM9WCDUSI09",
"START_DFU_FLASHER_SERIAL_SPEED=14400",
"START_YMODEM_FLASHER_SERIAL_SPEED=28800",
"STM32F2XX",
"STM32_DEVICE",
"SYSTEM_VERSION_STRING=0.7.0",
"USBD_PID_CDC=0xC006",
"USBD_PID_DFU=0xD006",
"USBD_VID_SPARK=0x2B04",
"USER_FIRMWARE_IMAGE_LOCATION=0x80A0000",
"USER_FIRMWARE_IMAGE_SIZE=0x20000",
"USE_STDPERIPH_DRIVER",
"_GNU_SOURCE",
"_WINSOCK_H"
],
"compilerSwitches":"-Wall -Wno-error=deprecated-declarations -Wno-switch -Wundef -fcheck-new -fdata-sections -ffunction-sections -fmessage-length=0 -fno-builtin-free -fno-builtin-malloc -fno-builtin-realloc -fno-exceptions -fno-rtti -fno-strict-aliasing -mcpu=cortex-m3 -mthumb -std=gnu++11 ",
"intelliSenseMode":"linux-gcc-arm"
},
{
"name":"Particle electron",
"includePath":[
"${workspaceRoot}\\..\\firmware\\communication\\src",
"${workspaceRoot}\\..\\firmware\\dynalib\\inc",
"${workspaceRoot}\\..\\firmware\\hal\\inc",
"${workspaceRoot}\\..\\firmware\\hal\\shared",
"${workspaceRoot}\\..\\firmware\\hal\\src\\electron",
"${workspaceRoot}\\..\\firmware\\hal\\src\\stm32",
"${workspaceRoot}\\..\\firmware\\hal\\src\\stm32f2xx",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\CMSIS\\Device\\ST\\Include",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\CMSIS\\Include",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\SPARK_Firmware_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_StdPeriph_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_Device_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_Host_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\STM32F2xx\\STM32_USB_OTG_Driver\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\MCU\\shared\\STM32\\inc",
"${workspaceRoot}\\..\\firmware\\platform\\shared\\inc",
"${workspaceRoot}\\..\\firmware\\services\\inc",
"${workspaceRoot}\\..\\firmware\\system\\inc",
"${workspaceRoot}\\..\\firmware\\user\\inc",
"${workspaceRoot}\\..\\firmware\\wiring\\inc",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\arm-none-eabi",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\arm-none-eabi\thumb",
"${workspaceRoot}\\..\\gcc-arm\\arm-none-eabi\\include\\c++\\5.3.1\\ext",
"${workspaceRoot}\\..\\gcc-arm\\lib\\gcc\\arm-none-eabi\\5.3.1\\include",
"${workspaceRoot}\\src"
],
"defines":[
"DFU_BUILD_ENABLE",
"INCLUDE_PLATFORM=1",
"LOG_INCLUDE_SOURCE_INFO=1",
"LOG_MODULE_CATEGORY=\"\\\"app\\\"\"",
"MODULAR_FIRMWARE=1",
"MODULE_DEPENDENCY2=0,0,0",
"MODULE_DEPENDENCY=4,2,207",
"MODULE_FUNCTION=5",
"MODULE_INDEX=1",
"MODULE_VERSION=5",
"PARTICLE=1",
"PARTICLE_USER_MODULE",
"PLATFORM_ID=10",
"PLATFORM_NAME=electron",
"PLATFORM_THREADING=1",
"PRODUCT_FIRMWARE_VERSION=65535",
"PRODUCT_ID=10",
"RELEASE_BUILD",
"SPARK=1",
"SPARK_PLATFORM",
"SPARK_PLATFORM_NET=UBLOXSARA",
"START_DFU_FLASHER_SERIAL_SPEED=14400",
"START_YMODEM_FLASHER_SERIAL_SPEED=28800",
"STM32F2XX",
"STM32_DEVICE",
"SYSTEM_VERSION_STRING=0.7.0",
"USBD_PID_CDC=0xC00A",
"USBD_PID_DFU=0xD00A",
"USBD_VID_SPARK=0x2B04",
"USER_FIRMWARE_IMAGE_LOCATION=0x8080000",
"USER_FIRMWARE_IMAGE_SIZE=0x20000",
"USE_STDPERIPH_DRIVER",
"_GNU_SOURCE",
"_WINSOCK_H"
],
"compilerSwitches":"-Wall -Wno-error=deprecated-declarations -Wno-switch -Wundef -fcheck-new -fdata-sections -ffunction-sections -fmessage-length=0 -fno-builtin-free -fno-builtin-malloc -fno-builtin-realloc -fno-exceptions -fno-rtti -fno-strict-aliasing -mcpu=cortex-m3 -mthumb -std=gnu++11 ",
"intelliSenseMode":"linux-gcc-arm"
}
]
}