summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--main/CMakeLists.txt5
-rw-r--r--src/drivers/CMakeLists.txt5
-rw-r--r--src/drivers/battery.cpp (renamed from main/battery.cpp)0
-rw-r--r--src/drivers/dac.cpp (renamed from main/dac.cpp)0
-rw-r--r--src/drivers/display-init.cpp (renamed from main/display-init.cpp)0
-rw-r--r--src/drivers/display.cpp (renamed from main/display.cpp)0
-rw-r--r--src/drivers/gpio-expander.cpp (renamed from main/gpio-expander.cpp)0
-rw-r--r--src/drivers/i2c.cpp (renamed from main/i2c.cpp)0
-rw-r--r--src/drivers/include/battery.hpp (renamed from main/battery.hpp)0
-rw-r--r--src/drivers/include/dac.hpp (renamed from main/dac.hpp)0
-rw-r--r--src/drivers/include/display-init.hpp (renamed from main/display-init.hpp)0
-rw-r--r--src/drivers/include/display.hpp (renamed from main/display.hpp)0
-rw-r--r--src/drivers/include/gpio-expander.hpp (renamed from main/gpio-expander.hpp)0
-rw-r--r--src/drivers/include/i2c.hpp (renamed from main/i2c.hpp)0
-rw-r--r--src/drivers/include/playback.hpp (renamed from main/playback.hpp)0
-rw-r--r--src/drivers/include/storage.hpp (renamed from main/storage.hpp)0
-rw-r--r--src/drivers/playback.cpp (renamed from main/playback.cpp)0
-rw-r--r--src/drivers/storage.cpp (renamed from main/storage.cpp)0
-rw-r--r--src/main/CMakeLists.txt3
-rw-r--r--src/main/main.cpp (renamed from main/gay-ipod-fw.cpp)0
21 files changed, 19 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5f8cb98..93dc6e89 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,25 @@
# 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.8)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include($ENV{ADF_PATH}/CMakeLists.txt)
+
+# Build only the subset of components that we actually depend on.
+set(COMPONENTS "")
+
+# External dependencies
list(APPEND EXTRA_COMPONENT_DIRS "lib/result")
list(APPEND EXTRA_COMPONENT_DIRS "lib/lvgl")
+# Project components
+list(APPEND EXTRA_COMPONENT_DIRS "src/")
+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(gay-ipod-fw)
+# Extra build flags that should apply to the entire build. This should mostly
+# just be used to setting flags that our external dependencies requires.
+# Otherwise, prefer adding per-component build flags to keep things neat.
idf_build_set_property(COMPILE_OPTIONS "-DRESULT_DISABLE_EXCEPTIONS -DLV_CONF_INCLUDE_SIMPLE" APPEND)
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
deleted file mode 100644
index 5ef0bf9e..00000000
--- a/main/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-idf_component_register(
- SRCS "gay-ipod-fw.cpp" "dac.cpp" "gpio-expander.cpp" "battery.cpp" "storage.cpp"
- "i2c.cpp" "playback.cpp" "display.cpp" "display-init.cpp"
- INCLUDE_DIRS "."
- REQUIRES "esp_adc_cal" "fatfs" "audio_pipeline" "audio_stream" "result" "lvgl")
diff --git a/src/drivers/CMakeLists.txt b/src/drivers/CMakeLists.txt
new file mode 100644
index 00000000..b9682050
--- /dev/null
+++ b/src/drivers/CMakeLists.txt
@@ -0,0 +1,5 @@
+idf_component_register(
+ SRCS "dac.cpp" "gpio-expander.cpp" "battery.cpp" "storage.cpp" "i2c.cpp"
+ "playback.cpp" "display.cpp" "display-init.cpp"
+ INCLUDE_DIRS "include"
+ REQUIRES "esp_adc_cal" "fatfs" "audio_pipeline" "audio_stream" "result" "lvgl")
diff --git a/main/battery.cpp b/src/drivers/battery.cpp
index 66c96daf..66c96daf 100644
--- a/main/battery.cpp
+++ b/src/drivers/battery.cpp
diff --git a/main/dac.cpp b/src/drivers/dac.cpp
index d74e9523..d74e9523 100644
--- a/main/dac.cpp
+++ b/src/drivers/dac.cpp
diff --git a/main/display-init.cpp b/src/drivers/display-init.cpp
index e4545339..e4545339 100644
--- a/main/display-init.cpp
+++ b/src/drivers/display-init.cpp
diff --git a/main/display.cpp b/src/drivers/display.cpp
index 8708436f..8708436f 100644
--- a/main/display.cpp
+++ b/src/drivers/display.cpp
diff --git a/main/gpio-expander.cpp b/src/drivers/gpio-expander.cpp
index 6b472d1c..6b472d1c 100644
--- a/main/gpio-expander.cpp
+++ b/src/drivers/gpio-expander.cpp
diff --git a/main/i2c.cpp b/src/drivers/i2c.cpp
index d3bfaa59..d3bfaa59 100644
--- a/main/i2c.cpp
+++ b/src/drivers/i2c.cpp
diff --git a/main/battery.hpp b/src/drivers/include/battery.hpp
index 399e866f..399e866f 100644
--- a/main/battery.hpp
+++ b/src/drivers/include/battery.hpp
diff --git a/main/dac.hpp b/src/drivers/include/dac.hpp
index 6d025384..6d025384 100644
--- a/main/dac.hpp
+++ b/src/drivers/include/dac.hpp
diff --git a/main/display-init.hpp b/src/drivers/include/display-init.hpp
index f11e9b57..f11e9b57 100644
--- a/main/display-init.hpp
+++ b/src/drivers/include/display-init.hpp
diff --git a/main/display.hpp b/src/drivers/include/display.hpp
index 2d6e9cd6..2d6e9cd6 100644
--- a/main/display.hpp
+++ b/src/drivers/include/display.hpp
diff --git a/main/gpio-expander.hpp b/src/drivers/include/gpio-expander.hpp
index 2a12fba4..2a12fba4 100644
--- a/main/gpio-expander.hpp
+++ b/src/drivers/include/gpio-expander.hpp
diff --git a/main/i2c.hpp b/src/drivers/include/i2c.hpp
index db554f5d..db554f5d 100644
--- a/main/i2c.hpp
+++ b/src/drivers/include/i2c.hpp
diff --git a/main/playback.hpp b/src/drivers/include/playback.hpp
index 493dd311..493dd311 100644
--- a/main/playback.hpp
+++ b/src/drivers/include/playback.hpp
diff --git a/main/storage.hpp b/src/drivers/include/storage.hpp
index cee49cc5..cee49cc5 100644
--- a/main/storage.hpp
+++ b/src/drivers/include/storage.hpp
diff --git a/main/playback.cpp b/src/drivers/playback.cpp
index 46dec680..46dec680 100644
--- a/main/playback.cpp
+++ b/src/drivers/playback.cpp
diff --git a/main/storage.cpp b/src/drivers/storage.cpp
index 7fed6ed0..7fed6ed0 100644
--- a/main/storage.cpp
+++ b/src/drivers/storage.cpp
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
new file mode 100644
index 00000000..b744a447
--- /dev/null
+++ b/src/main/CMakeLists.txt
@@ -0,0 +1,3 @@
+idf_component_register(
+ SRCS "main.cpp"
+ REQUIRES "drivers")
diff --git a/main/gay-ipod-fw.cpp b/src/main/main.cpp
index 8d989146..8d989146 100644
--- a/main/gay-ipod-fw.cpp
+++ b/src/main/main.cpp