您好,
1、我想在VSCODE里面将一些通用的模块,例如LED、BEEP、KEY这些,类似于Keil的工程管理方法,模块可以复用
2、这样我有3个跟业务相关的应用程序: AirClear、RemoteIR、Gateway可以直接调用通用模块;
3、例如AirClear
a)我修改了c_cpp_properties.json:
"includePath": [
"${workspaceRoot}",
"M:\ESP32\esp-idf\components",
"M:/ESP32/esp-idf/components/newlib/include",
"M:/ESP32/esp-idf/components/esp32/include",
"${workspaceFolder}/components/user_driver/include",
"M:/ESP32/esp32_win32_msys2_environment_and_toolchain-20180110/msys32/opt/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/5.2.0/include",
"M:/ESP32/esp-idf/components/driver/include",
"M:/ESP32/esp-idf/components/soc/esp32/include",
"M:/ESP32/esp-idf/components/freertos/include",
"${workspaceFolder}/build/config",
"M:/ESP32/esp-idf/components/log/include",
"M:/ESP32/esp-idf/components/heap/include",
"M:/ESP32/esp-idf/components/soc/include",
"M:/ESP32/esp-idf/components/spi_flash/include",
"M:/ESP32/esp-idf/components/tcpip_adapter/include",
"M:/ESP32/esp-idf/components/lwip/include/lwip",
"M:/ESP32/esp-idf/components/lwip/include/lwip/port",
"M:/ESP32/esp-idf/components/vfs/include",
"M:/ESP32/esp-idf/components/nvs_flash/include",
"M:/ESP32/esp-idf/components/newlib/platform_include",
"M:/ESP32/esp-idf/components/mbedtls/mbedtls/include",
"M:/ESP32/esp-idf/components/json/cJSON",
"M:/ESP32/esp-idf/components/wpa_supplicant/port/include",
//我添加的自定义模块路径
"M:/ESP32/esp-idf/app/Hardware",
"M:/ESP32/esp-idf/app/Hardware/Uart1"
b)在main文件里面:
#include "Hardware/Bsp.h"
// #include "../../Hardware/Bsp.h" //目录层级关系
void app_main()
c)编译的时候发现还是找不到Bsp.h文件。
Administrator@ThinK-PC MINGW32 /m/ESP32/esp-idf/app/Main/AirClear
$ make app -j8
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
CC build/main/main.o
M:/ESP32/esp-idf/app/Main/AirClear/main/main.c:10:26: fatal error: Hardware/Bsp.h: No such file or directory
compilation terminated.