2 Replies Latest reply on Aug 10, 2018 2:54 AM by DheerajK_81

    How to list predefined macros in the preprocessor


      Hi, I'm working on porting the Marlin 3D printing firmware to the PSoC 4 architecture, I have downloaded the Marlin repository and the conditional compiling checks for predefined macros to see what type of architecture/chip you are compiling to. I'm wandering if there are similar system specific predefined macros in the PSoC IDE preprocessor to tell the compiler to use the files I'll write. Something like "__TARGET_CY8C_4125__" or "__CY_4100_FAMILY__" as shown below:


      #ifdef __AVR__

        #define HAL_PLATFORM HAL_AVR

      #elif defined(ARDUINO_ARCH_SAM)

        #define HAL_PLATFORM HAL_DUE

      #elif defined(__MK64FX512__) || defined(__MK66FX1M0__)

        #define HAL_PLATFORM HAL_TEENSY35_36

      #elif defined(TARGET_LPC1768)

        #define HAL_PLATFORM HAL_LPC1768

      #elif defined(__STM32F1__) || defined(TARGET_STM32F1)

        #define HAL_PLATFORM HAL_STM32F1

      #elif defined(STM32F4) || defined(STM32F4xx)

        #define HAL_PLATFORM HAL_STM32F4

      #elif defined(STM32F7)

        #define HAL_PLATFORM HAL_STM32F7

      #elif defined(ARDUINO_ARCH_ESP32)

        #define HAL_PLATFORM HAL_ESP32


        #error "Unsupported Platform!"


      At the moment I'm getting the "Unsupported Platform!" error as expected. I checked the GNU documentation included with PSoC creator and it says I can run the preprocessor alone with cpp -dM but I don't know where it is located to run it from the cmd window.


      Thanks for your feedback.