VScode开发stc15单片机之问题记录

问题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”里面的报警就不会出现了。

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值