Code: Select all
C:\ESP\sprinkle
└─sprinkle-sensor
├─CMakeLists.txt
├─sdkconfig
├─build
├─components
│ └─sprinkle_common
│ ├─CMakeLists.txt
│ ├─component.mk
│ ├─sprinkle_common.c
│ └─include
│ └─sprinkle_common.h
└─main
├─CMakeLists.txt
└─sprinkle-sensor.c
Code: Select all
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five 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.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(sprinkle-sensor)
Code: Select all
#include <stdio.h>
#include "sprinkle_common.h"
void app_main(void) {
printf("MESSAGE_MOISTURE_SENSOR=%d\n", MESSAGE_MOISTURE_SENSOR);
}
Code: Select all
C:\ESP\sprinkle
├─components
│ └─sprinkle_common
│ ├─CMakeLists.txt
│ ├─component.mk
│ ├─sprinkle_common.c
│ └─include
│ └─sprinkle_common.h
└─sprinkle-sensor
├─CMakeLists.txt
├─sdkconfig
├─build
└─main
├─CMakeLists.txt
└─sprinkle-sensor.c
Code: Select all
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five 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.16)
set(EXTRA_COMPONENTS_DIR ..)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(sprinkle-sensor)
Code: Select all
C:/ESP/sprinkle/sprinkle-sensor/main/sprinkle-sensor.c:15:10: fatal error: sprinkle_common.h: No such file or directory
15 | #include "sprinkle_common.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
What am I doing wrong?