赞
踩
问题1:自己在c_cpp_properties文件里添加的设置,但是每次重新打开VScode时,c_cpp_properties被覆盖重写,恢复了最初设置。
解决方法:"file"—"preferences"—"setting"—"preference"—"extensions"
查找platformio配置项 Auto Rebuild Autocomplete Index 把该选项的勾去掉 后重启软件,问题解决。
参考:win10+vscode+platformio中c_cpp_properties被覆盖的问题 - 程序员大本营 (pianshen.com)
问题2: warning 84: 'auto' variable '_nop_' may be used before initialization ;
__nop_()没有定义,在头文件里重新定义
#define _nop_() __asm nop __endasm
问题3:寄存器定义 举例
__sfr __at (0x80) P0 ;
__sfr __at (0x81) SP ;
__sfr __at (0x82) DPL ;
__sfr __at (0x83) DPH ;
问题4:IO口定义 举例
#define CLK164A P13
#define DAT164A P12
#define CLK164B P15
#define DAT164B P14
//__sbit __at 0x93 CLK164A;
//__sbit __at 0x92 DAT164A;
//__sbit __at 0x95 CLK164B;
//__sbit __at 0x94 DAT164B;
问题5:Error: The PlatformIO task detection didn't contribute a task for the following configuration;
解决方式:新建一个task.json 文件。
{
"version": "2.0.0",
"tasks": [
{
"type": "PlatformIO",
"task": "Build",
"problemMatcher": [
"$platformio"
],
"group": "build",
"label": "PlatformIO: Build"
}
]
}
问题5:VScode关闭针对C/C++的错误告警。
解决方法:在“setting”选项搜索“C_Cpp.errorSquiggles”如下图,选择“Disabled”,之后在“problems”里面的报警就不会出现了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。