当前位置:网站首页>Esp32 construction engineering add components

Esp32 construction engineering add components

2022-07-07 13:19:00 Lee1989 Qi

One 、 Top level documents CMakeList.txt

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{
    IDF_PATH}/tools/cmake/project.cmake)

project(3_4_lcd) The project name here is to copy other people's components , Except that the project name is modified by itself, the others remain unchanged 
  • Component files CMakeList.txt
  • Whether it's app_main.c Or do other components need CMakeList.txt

Two 、 Component files CMakeList.txt

idf_component_register(SRCS "Lcd.c" 
                    // Under components .c File name 
                    INCLUDE_DIRS "."
                    // Under the current file directory 
                    REQUIRES driver)
           // Refer to the esp-idf The component of is equal to stm32 Library function 

 Insert picture description here
 Insert picture description here

3、 ... and 、 Component files reference other components

  • At other points c Introduce other points under the file c The file only needs to be in CmakeList Import the corresponding header file under the file, such as
     Insert picture description here
     Insert picture description here
原网站

版权声明
本文为[Lee1989 Qi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071119176028.html