Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
This commit is contained in:
committed by
GitHub
parent
7856827ecf
commit
c87200a80d
@@ -13,7 +13,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source/"
|
||||
INCLUDE_DIRS "Include/"
|
||||
PRIV_INCLUDE_DIRS "Private/"
|
||||
REQUIRES ${REQUIRES_LIST}
|
||||
)
|
||||
@@ -25,31 +25,29 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
fatfs_create_spiflash_image(data "${CMAKE_CURRENT_SOURCE_DIR}/../Data/data" FLASH_IN_PROJECT PRESERVE_TIME)
|
||||
endif()
|
||||
|
||||
add_definitions(-DESP_PLATFORM)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC -Wno-unused-variable)
|
||||
endif()
|
||||
else()
|
||||
file(GLOB_RECURSE SOURCES "Source/*.c*")
|
||||
file(GLOB_RECURSE HEADERS "Source/*.h*")
|
||||
|
||||
add_library(TactilityHeadless OBJECT)
|
||||
target_sources(TactilityHeadless
|
||||
PRIVATE ${SOURCES}
|
||||
PUBLIC ${HEADERS}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
Private/
|
||||
Include/
|
||||
)
|
||||
|
||||
target_include_directories(TactilityHeadless
|
||||
PUBLIC Source/
|
||||
PUBLIC Include/
|
||||
)
|
||||
|
||||
add_definitions(-D_Nullable=)
|
||||
add_definitions(-D_Nonnull=)
|
||||
|
||||
target_link_libraries(TactilityHeadless
|
||||
PUBLIC TactilityCore
|
||||
PUBLIC freertos_kernel
|
||||
|
||||
+4
-3
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "TactilityCore.h"
|
||||
#include "hal/Configuration.h"
|
||||
#include "Dispatcher.h"
|
||||
#include "Tactility/hal/Configuration.h"
|
||||
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <Tactility/Dispatcher.h>
|
||||
|
||||
namespace tt {
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Power.h"
|
||||
#include "hal/i2c/I2c.h"
|
||||
#include "SdCard.h"
|
||||
#include "./Power.h"
|
||||
#include "./SdCard.h"
|
||||
#include "./i2c/I2c.h"
|
||||
|
||||
namespace tt::hal {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "TactilityCore.h"
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
namespace tt::hal {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "hal/SdCard.h"
|
||||
#include "Tactility/hal/SdCard.h"
|
||||
|
||||
#include <sd_protocol_types.h>
|
||||
#include <utility>
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "I2cCompat.h"
|
||||
#include "RtosCompat.h"
|
||||
#include "./I2cCompat.h"
|
||||
|
||||
#include <Tactility/RtosCompat.h>
|
||||
|
||||
#include <climits>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Mutex.h"
|
||||
#include "ServiceManifest.h"
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace tt::service {
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "service/Service.h"
|
||||
#include "Tactility/service/Service.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace tt::service {
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "service/ServiceManifest.h"
|
||||
#include "service/Service.h"
|
||||
#include "ServiceManifest.h"
|
||||
#include "Service.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace tt::service {
|
||||
+5
-3
@@ -1,8 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "PubSub.h"
|
||||
#include "WifiGlobals.h"
|
||||
#include "WifiSettings.h"
|
||||
#include "./WifiGlobals.h"
|
||||
#include "./WifiSettings.h"
|
||||
|
||||
#include <Tactility/PubSub.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "hal/Configuration.h"
|
||||
#include "Tactility/hal/Configuration.h"
|
||||
|
||||
namespace tt::hal {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "service/ServiceContext.h"
|
||||
#include "service/Service.h"
|
||||
#include "Tactility/service/ServiceContext.h"
|
||||
#include "Tactility/service/Service.h"
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "service/ServiceInstance.h"
|
||||
#include "Tactility/service/ServiceInstance.h"
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "EspPartitions_i.h"
|
||||
#include "Log.h"
|
||||
#include "Tactility/PartitionsEsp.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
|
||||
#include <esp_vfs_fat.h>
|
||||
#include <nvs_flash.h>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "nvs_flash.h"
|
||||
#include "Preferences.h"
|
||||
#include "TactilityCore.h"
|
||||
#include "Tactility/Preferences.h"
|
||||
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
#define TAG "preferences"
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef ESP_PLATFOM
|
||||
|
||||
#include "Bundle.h"
|
||||
#include "Preferences.h"
|
||||
#include "Tactility/Preferences.h"
|
||||
|
||||
#include <Tactility/Bundle.h>
|
||||
|
||||
namespace tt {
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#include <Dispatcher.h>
|
||||
#include "TactilityHeadless.h"
|
||||
#include "hal/Configuration.h"
|
||||
#include "hal/Hal_i.h"
|
||||
#include "service/ServiceManifest.h"
|
||||
#include "service/ServiceRegistry.h"
|
||||
#include "kernel/SystemEvents.h"
|
||||
#include "network/NtpPrivate.h"
|
||||
#include "time/TimePrivate.h"
|
||||
#include "Tactility/TactilityHeadless.h"
|
||||
#include "Tactility/hal/Configuration.h"
|
||||
#include "Tactility/hal/Hal_i.h"
|
||||
#include "Tactility/network/NtpPrivate.h"
|
||||
#include "Tactility/service/ServiceManifest.h"
|
||||
#include "Tactility/service/ServiceRegistry.h"
|
||||
|
||||
#include <Tactility/Dispatcher.h>
|
||||
#include <Tactility/time/TimePrivate.h>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include "EspInit.h"
|
||||
#include "Tactility/InitEsp.h"
|
||||
#endif
|
||||
|
||||
namespace tt {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "TactilityCore.h"
|
||||
#include "EspPartitions_i.h"
|
||||
#include "Tactility/PartitionsEsp.h"
|
||||
#include "Tactility/TactilityCore.h"
|
||||
|
||||
#include "esp_event.h"
|
||||
#include "esp_netif.h"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "hal/Hal_i.h"
|
||||
#include "hal/i2c/I2c.h"
|
||||
#include "kernel/SystemEvents.h"
|
||||
#include "Tactility/hal/Hal_i.h"
|
||||
#include "Tactility/hal/i2c/I2c.h"
|
||||
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
|
||||
#define TAG "hal"
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "SpiSdCard.h"
|
||||
#include "Tactility/hal/SpiSdCard.h"
|
||||
|
||||
#include "Check.h"
|
||||
#include "Log.h"
|
||||
#include <Tactility/Log.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_vfs_fat.h>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "I2c.h"
|
||||
#include "Log.h"
|
||||
#include "Mutex.h"
|
||||
#include "Tactility/hal/i2c/I2c.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
#include <esp_check.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "I2cDevice.h"
|
||||
#include "Tactility/hal/i2c/I2cDevice.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
bool I2cDevice::readRegister12(uint8_t reg, float& out) const {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/**
|
||||
* This code is based on i2c_manager from https://github.com/ropg/i2c_manager/blob/master/i2c_manager/i2c_manager.c (original has MIT license)
|
||||
*/
|
||||
#include "TactilityCore.h"
|
||||
#include "I2c.h"
|
||||
#include "Tactility/TactilityCore.h"
|
||||
#include "Tactility/hal/i2c/I2c.h"
|
||||
|
||||
namespace tt::hal::i2c {
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include <Log.h>
|
||||
#include "Usb.h"
|
||||
#include "UsbTusb.h"
|
||||
#include "TactilityHeadless.h"
|
||||
#include "hal/SpiSdCard.h"
|
||||
#include "Tactility/hal/usb/Usb.h"
|
||||
#include "Tactility/hal/usb/UsbTusb.h"
|
||||
#include "Tactility/hal/SpiSdCard.h"
|
||||
#include "Tactility/TactilityHeadless.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
|
||||
namespace tt::hal::usb {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "Usb.h"
|
||||
#include "Tactility/hal/usb/Usb.h"
|
||||
|
||||
#define TAG "usb"
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "UsbTusb.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "Tactility/hal/usb/UsbTusb.h"
|
||||
|
||||
#include <sdkconfig.h>
|
||||
|
||||
#if CONFIG_TINYUSB_MSC_ENABLED == 1
|
||||
|
||||
#include "Log.h"
|
||||
#include "tinyusb.h"
|
||||
#include "tusb_msc_storage.h"
|
||||
#include <Tactility/Log.h>
|
||||
#include <tinyusb.h>
|
||||
#include <tusb_msc_storage.h>
|
||||
|
||||
#define TAG "usb"
|
||||
#define EPNUM_MSC 1
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "SystemEvents.h"
|
||||
#include "Mutex.h"
|
||||
#include "CoreExtraDefines.h"
|
||||
#include "Tactility/kernel/SystemEvents.h"
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/CoreExtraDefines.h>
|
||||
|
||||
#include <list>
|
||||
|
||||
#define TAG "system_event"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "network/NtpPrivate.h"
|
||||
#include "Tactility/network/NtpPrivate.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include "kernel/SystemEvents.h"
|
||||
#include "TactilityCore.h"
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <esp_netif_sntp.h>
|
||||
#include <esp_sntp.h>
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "service/ServiceInstance.h"
|
||||
#include "service/ServiceInstancePaths.h"
|
||||
#include "Tactility/service/ServiceInstance.h"
|
||||
#include "Tactility/service/ServiceInstancePaths.h"
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "service/ServiceInstancePaths.h"
|
||||
#include "Partitions.h"
|
||||
#include "Tactility/service/ServiceInstancePaths.h"
|
||||
|
||||
#include "Tactility/Partitions.h"
|
||||
|
||||
#define LVGL_PATH_PREFIX std::string("A:/")
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "ServiceRegistry.h"
|
||||
#include "Tactility/service/ServiceRegistry.h"
|
||||
|
||||
#include "Tactility/service/ServiceInstance.h"
|
||||
#include "Tactility/service/ServiceManifest.h"
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
#include "Mutex.h"
|
||||
#include "service/ServiceInstance.h"
|
||||
#include "service/ServiceManifest.h"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "Mutex.h"
|
||||
#include "Timer.h"
|
||||
#include "Tactility/service/ServiceContext.h"
|
||||
#include "Tactility/TactilityHeadless.h"
|
||||
#include "Tactility/service/ServiceRegistry.h"
|
||||
|
||||
#include "service/ServiceContext.h"
|
||||
#include "TactilityHeadless.h"
|
||||
#include "service/ServiceRegistry.h"
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
#define TAG "sdcard_service"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "./Wifi.h"
|
||||
#include "Tactility/service/wifi/Wifi.h"
|
||||
|
||||
namespace tt::service::wifi {
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "Wifi.h"
|
||||
#include "Tactility/service/wifi/Wifi.h"
|
||||
|
||||
#include "TactilityHeadless.h"
|
||||
#include "Timer.h"
|
||||
#include "service/ServiceContext.h"
|
||||
#include "WifiSettings.h"
|
||||
#include "Tactility/TactilityHeadless.h"
|
||||
#include "Tactility/service/ServiceContext.h"
|
||||
#include "Tactility/service/wifi/WifiSettings.h"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <cstring>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "Wifi.h"
|
||||
#include "Tactility/service/wifi/Wifi.h"
|
||||
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "Check.h"
|
||||
#include "Log.h"
|
||||
#include "MessageQueue.h"
|
||||
#include "Mutex.h"
|
||||
#include "PubSub.h"
|
||||
#include "service/ServiceContext.h"
|
||||
#include "Tactility/service/ServiceContext.h"
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/PubSub.h>
|
||||
|
||||
namespace tt::service::wifi {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Preferences.h"
|
||||
#include "Tactility/Preferences.h"
|
||||
|
||||
#define WIFI_PREFERENCES_NAMESPACE "wifi"
|
||||
#define WIFI_PREFERENCES_KEY_ENABLE_ON_BOOT "enable_on_boot"
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "WifiGlobals.h"
|
||||
#include "WifiSettings.h"
|
||||
#include <cstring>
|
||||
#include "Tactility/service/wifi/WifiGlobals.h"
|
||||
#include "Tactility/service/wifi/WifiSettings.h"
|
||||
|
||||
#include "nvs_flash.h"
|
||||
#include "Log.h"
|
||||
#include "crypt/Hash.h"
|
||||
#include "crypt/Crypt.h"
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/crypt/Hash.h>
|
||||
#include <Tactility/crypt/Crypt.h>
|
||||
|
||||
#include <nvs_flash.h>
|
||||
#include <cstring>
|
||||
|
||||
#define TAG "wifi_settings"
|
||||
#define TT_NVS_NAMESPACE "wifi_settings" // limited by NVS_KEY_NAME_MAX_SIZE
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "WifiSettings.h"
|
||||
#include "Log.h"
|
||||
#include "Tactility/service/wifi/WifiSettings.h"
|
||||
|
||||
namespace tt::service::wifi::settings {
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#include "Tactility/time/Time.h"
|
||||
#include "Tactility/kernel/SystemEvents.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <ctime>
|
||||
#include "Time.h"
|
||||
#include "Preferences.h"
|
||||
#include "kernel/SystemEvents.h"
|
||||
#include "Tactility/Preferences.h"
|
||||
#endif
|
||||
|
||||
namespace tt::time {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user