【发布时间】:2020-12-07 17:10:30
【问题描述】:
我有一个使用 arm-none-eabi 编译器编译的 Cortex-M4F 微控制器的 makefile 项目,并且我对一些浮点数使用 __fp16 存储类型。我正在使用 Visual Studio Code 来编辑代码,并使用 makefile 进行编译。
我的代码编译正常,但 Visual Studio Code 无法识别 __fp16 存储类型。
我正在使用 c_cpp_properties.json 来配置编译器和一个 compile_commands.json。
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/../**",
"/usr/local/FreeRTOSv10.2.0/FreeRTOS/**"
],
"defines": [
"DEBUG=1",
"FIRMWARE_VERSION=\"DUMMY\""
],
"compilerPath": "/usr/local/bin/gcc-arm-none-eabi-8-2018-q4-major/bin/arm-none-eabi-gcc",
"compilerArgs": [
"-mcpu=cortex-m4",
"-march=armv7+fp",
"-mfpu=fpv4-sp-d16",
"-mfloat-abi=hard",
"-mfp16-format=ieee"
],
"intelliSenseMode": "gcc-arm",
"cStandard": "c11",
"compileCommands": "${workspaceFolder}/compile_commands.json"
}
],
"version": 4
}
如何向 Visual Studio Code 教授 __fp16 存储类型?我认为它会发现带有 compilerArgs 设置和 -mfp16-format=ieee 参数的类型,但它似乎没有什么不同(我在这里尝试了各种组合......)。
【问题讨论】:
标签: c visual-studio-code arm intellisense