如何解决使用VScode配置STM32环境时出现的报错问题?

摘要:使用VScode配置STM32环境报错问题解决办法 现象:部分.h文件出现uint8_t 未定义报错(红色波浪线,编译正常) #ifndef __MYI2C_H #define __MYI2C_H#include &
使用VScode配置STM32环境报错问题解决办法 现象:部分.h文件出现uint8_t 未定义报错(红色波浪线,编译正常) #ifndef __MYI2C_H #define __MYI2C_H // #include <stdint.h> // 第一种方法:避免 uint8_t 未定义报错 //"forcedInclude": ["C:\\Keil_v5\\ARM\\ARMCC\\include\\stdint.h"] // 第二种方法:避免 uint8_t 未定义报错 void MyI2C_Init(void); void MyI2C_Start(void); void MyI2C_Stop(void); void MyI2C_SendByte(uint8_t Byte); uint8_t MyI2C_ReceiveByte(void); void MyI2C_SendAck(uint8_t AckBit); uint8_t MyI2C_ReceiveAck(void); #endif 举例如下: { "configurations": [ { "name": "Target 1", "includePath": [ "c:\\Gitee\\stm32\\00_三刷\\10-1 软件I2C读写MPU6050\\Start", "c:\\Gitee\\stm32\\00_三刷\\10-1 软件I2C读写MPU6050\\Library", "c:\\Gitee\\stm32\\00_三刷\\10-1 软件I2C读写MPU6050\\User", "c:\\Gitee\\stm32\\00_三刷\\10-1 软件I2C读写MPU6050\\System", "c:\\Gitee\\stm32\\00_三刷\\10-1 软件I2C读写MPU6050\\Hardware", "C:\\Keil_v5\\ARM\\ARMCC\\include", "C:\\Keil_v5\\ARM\\ARMCC\\include\\rw" ], "defines": [ "USE_STDPERIPH_DRIVER", "__CC_ARM", "__arm__", "__align(x)=", "__ALIGNOF__(x)=", "__alignof__(x)=", "__asm(x)=", "__forceinline=", "__restrict=", "__global_reg(n)=", "__inline=", "__int64=long long", "__INTADDR__(expr)=0", "__irq=", "__packed=", "__pure=", "__smc(n)=", "__svc(n)=", "__svc_indirect(n)=", "__svc_indirect_r7(n)=", "__value_in_regs=", "__weak=", "__writeonly=", "__declspec(x)=", "__attribute__(x)=", "__nonnull__(x)=", "_
阅读全文