IntelliSense.props automatic soft/hard fp predefined macrfo

Sysprogs forums Forums VisualGDB IntelliSense.props automatic soft/hard fp predefined macrfo

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31174
    itxs
    Participant

    Hi, I see that VisualGDB IntelliSense doesn’t make sense of the project’s currently selected type of floating-point. It just put ‘softfp’ and then does wrong macro selection in standard Cortex M header:

    #elif defined ( __GNUC__ )
      #if defined (__VFP_FP__) && !defined(__SOFTFP__)
        #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
          #define __FPU_USED       1U
        #else
          #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
          #define __FPU_USED       0U
        #endif
      #else
        #define __FPU_USED         0U
      #endif

    However, I noticed that it allows conditional addition to predefined macro container called %(ClCompile.PreprocessorDefinitions), something like

    <ClCompile Condition=”‘@(ToolchainSettingsContainer->Metadata(‘ARMCPU’))’ == ‘cortex-m0′”>

    Could you tell me how to make a condition for automatic soft/hard floating point selection? Something like:

     

    <ClCompile Condition=”‘@(ToolchainSettingsContainer->Metadata(‘FPUType’))’ == ‘soft'”>

    //… add __SOFTFP__ macro, etc

    Or if there is a FPU:

    <ClCompile Condition=”‘@(ToolchainSettingsContainer->Metadata(‘FPUType’))’ == ‘hard'”>

    //… add __VFP_FP__ macro, __FPU_PRESENT=1, etc

    #31175
    itxs
    Participant

    I ve done it by myself, there is a patched version of C:\SysGCC\arm-eabi\IntelliSense.props in the attachment

    Attachments:
    You must be logged in to view attached files.
    #31188
    support
    Keymaster

    Hi,

    Thanks for sharing this. The exact FPU macros also depend on the selected CPU/FPU type, so the logic for detecting them based on the “-mfloat-abi” option alone indeed won’t be 100% accurate. That said, it only affects IntelliSense and will not cause any behavioral issues in the code. Editing the file IntelliSense.props file manually (or adding the extra IntelliSense flags options via VisualGDB Project Properties -> IntelliSense Settings) should indeed work around it.

    Also, please consider switching to the new Advanced CMake Embedded Project subsystem. It uses a different mechanism for configuring IntelliSense that is not prone to this issue.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.