3 Replies Latest reply on Apr 21, 2020 7:03 PM by NoriakiT_91

    How to know the current core while being compiled for PSoC 6 Dual Core?




      I'm trying to understand how to determine the core that is currently being compiled while defining the proper macros for each core. I can see from the device header file with something like:

      #if ((defined(__GNUC__)        && (__ARM_ARCH == 6) && (__ARM_ARCH_6M__ == 1)) || \
           (defined(__ICCARM__)      && (__CORE__ == __ARM6M__)) || \
           (defined(__ARMCC_VERSION) && (__TARGET_ARCH_THUMB == 3)) || \
           (defined(__ghs__)         && defined(__CORE_CORTEXM0PLUS__)))

      to determine which core header file to include (e.g., core_cm0plus.h or core_cm4.h).


      Since I'm using ARMCC, is there any way to understand how __TARGET_ARCH_THUMB is defined to know which core the PSoC Creator is currently compiling?