soc: use include_next for including common touch sensor hal header

This commit is contained in:
Renz Christian Bagaporo 2020-01-09 14:43:41 +08:00
parent 1f2e2fe8af
commit b675df4b08
5 changed files with 16 additions and 10 deletions

View file

@ -37,7 +37,11 @@ elseif(CONFIG_IDF_TARGET_ESP32S2)
target_sources(${COMPONENT_LIB} PRIVATE "src/hal/spi_flash_hal_gpspi.c")
endif()
# Since there can be chip-specific HAL headers which can include the common
# HAL header via include_next, process the build scripts here first so that
# include directories appear first in the compile command.
add_subdirectory(src/${target})
target_include_directories(${COMPONENT_LIB} PUBLIC include)
add_subdirectory(soc)
target_link_libraries(${COMPONENT_LIB} PUBLIC "soc_${target}")
add_subdirectory(src/${target})

View file

@ -1,10 +1,14 @@
SOC_NAME := $(IDF_TARGET)
COMPONENT_SRCDIRS := src src/hal
COMPONENT_ADD_INCLUDEDIRS :=
COMPONENT_ADD_INCLUDEDIRS := include
# Since there can be chip-specific HAL headers which can include the common
# HAL header via include_next, process the build scripts here first so that
# include directories appear first in the compile command.
-include $(COMPONENT_PATH)/src/$(SOC_NAME)/component.mk
COMPONENT_ADD_INCLUDEDIRS += include
-include $(COMPONENT_PATH)/soc/component.mk
-include $(COMPONENT_PATH)/src/$(SOC_NAME)/component.mk
COMPONENT_ADD_LDFRAGMENTS += linker.lf

View file

@ -25,12 +25,6 @@
#include "hal/touch_sensor_ll.h"
#include "hal/touch_sensor_types.h"
#ifdef CONFIG_IDF_TARGET_ESP32
#include "hal/touch_sensor_hal_esp32.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "hal/touch_sensor_hal_esp32s2.h"
#endif
typedef struct {
touch_high_volt_t refh;
touch_low_volt_t refl;

View file

@ -25,6 +25,8 @@
#include "hal/touch_sensor_ll.h"
#include "hal/touch_sensor_types.h"
#include_next "hal/touch_sensor_hal.h"
/**
* Set touch sensor measurement time.
*

View file

@ -25,6 +25,8 @@
#include "hal/touch_sensor_ll.h"
#include "hal/touch_sensor_types.h"
#include_next "hal/touch_sensor_hal.h"
/**
* Reset the whole of touch module.
*