From c798e81c14328e334f49cd5942946bb136c74b02 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Tue, 9 Apr 2024 17:59:14 +0200 Subject: [PATCH] moved general drivers into library source directory --- .gitignore | 1 + {common => examples/common}/ConfigApp.cpp | 0 {common => examples/common}/ConfigApp.hpp | 0 {common => examples/common}/comm.pb.c | 0 {common => examples/common}/comm.pb.h | 0 {common => examples/common}/comm.proto | 0 examples/freenove-tank/freenove-tank.cpp | 8 ++--- .../m5stickCplus-joystick-tank.cpp | 3 +- .../xiao-espnow-sender/xiao-espnow-sender.cpp | 7 ++-- platformio.ini | 34 +++++++------------ {common => src/drivers}/CamFreenove.cpp | 0 {common => src/drivers}/CamFreenove.h | 0 {common => src/drivers}/CamXiao.cpp | 0 {common => src/drivers}/CamXiao.h | 0 .../drivers}/S3_Parallel16_ili9488.h | 0 {common => src/drivers}/xiao_pins.h | 0 16 files changed, 22 insertions(+), 31 deletions(-) rename {common => examples/common}/ConfigApp.cpp (100%) rename {common => examples/common}/ConfigApp.hpp (100%) rename {common => examples/common}/comm.pb.c (100%) rename {common => examples/common}/comm.pb.h (100%) rename {common => examples/common}/comm.proto (100%) rename {common => src/drivers}/CamFreenove.cpp (100%) rename {common => src/drivers}/CamFreenove.h (100%) rename {common => src/drivers}/CamXiao.cpp (100%) rename {common => src/drivers}/CamXiao.h (100%) rename {common => src/drivers}/S3_Parallel16_ili9488.h (100%) rename {common => src/drivers}/xiao_pins.h (100%) diff --git a/.gitignore b/.gitignore index 7a41560..a040ef0 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ deploy.sh releases releases/binaries/ releases/installer/ +examples/espcamlib diff --git a/common/ConfigApp.cpp b/examples/common/ConfigApp.cpp similarity index 100% rename from common/ConfigApp.cpp rename to examples/common/ConfigApp.cpp diff --git a/common/ConfigApp.hpp b/examples/common/ConfigApp.hpp similarity index 100% rename from common/ConfigApp.hpp rename to examples/common/ConfigApp.hpp diff --git a/common/comm.pb.c b/examples/common/comm.pb.c similarity index 100% rename from common/comm.pb.c rename to examples/common/comm.pb.c diff --git a/common/comm.pb.h b/examples/common/comm.pb.h similarity index 100% rename from common/comm.pb.h rename to examples/common/comm.pb.h diff --git a/common/comm.proto b/examples/common/comm.proto similarity index 100% rename from common/comm.proto rename to examples/common/comm.proto diff --git a/examples/freenove-tank/freenove-tank.cpp b/examples/freenove-tank/freenove-tank.cpp index 147ef7e..7003027 100644 --- a/examples/freenove-tank/freenove-tank.cpp +++ b/examples/freenove-tank/freenove-tank.cpp @@ -7,11 +7,11 @@ #include #include -#include "CamFreenove.h" -#include "ESPNowCam.h" -#include "comm.pb.h" +#include +#include +#include +#include #include -#include "ConfigApp.hpp" #include #define BUILTINLED 2 diff --git a/examples/m5stickCplus-joystick-tank/m5stickCplus-joystick-tank.cpp b/examples/m5stickCplus-joystick-tank/m5stickCplus-joystick-tank.cpp index 488be4b..e72fdd5 100644 --- a/examples/m5stickCplus-joystick-tank/m5stickCplus-joystick-tank.cpp +++ b/examples/m5stickCplus-joystick-tank/m5stickCplus-joystick-tank.cpp @@ -1,9 +1,8 @@ #include -#include #include #include #include "ESPNowCam.h" -#include "comm.pb.h" +#include ESPNowCam radio; diff --git a/examples/xiao-espnow-sender/xiao-espnow-sender.cpp b/examples/xiao-espnow-sender/xiao-espnow-sender.cpp index fe7d94c..ff06bb2 100644 --- a/examples/xiao-espnow-sender/xiao-espnow-sender.cpp +++ b/examples/xiao-espnow-sender/xiao-espnow-sender.cpp @@ -6,10 +6,9 @@ **************************************************/ #include -#include -#include "ESPNowCam.h" -#include "CamXiao.h" -#include "Utils.h" +#include +#include +#include CamXiao Camera; ESPNowCam radio; diff --git a/platformio.ini b/platformio.ini index ee0e4b4..c36bfe7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -4,7 +4,7 @@ [platformio] src_dir = ./examples/ -lib_dir = ./ +lib_dir = ./examples/espcamlib [env] platform = espressif32 @@ -19,6 +19,9 @@ build_flags = ; -Werror -D CORE_DEBUG_LEVEL=0 -D BOARD_HAS_PSRAM=1 +lib_deps = + nanopb/Nanopb@0.4.8 +extra_scripts = pre:prebuild.py [esp32common] extends = env @@ -29,18 +32,14 @@ board_build.partitions = ./config/partitions.csv [env:xiao-espnow-sender] extends = esp32common board_build.arduino.memory_type = dio_opi ; -build_src_filter = -<*> + -lib_deps = - nanopb/Nanopb@0.4.8 - https://github.com/hpsaturn/SerialTerminal.git - hpsaturn/ESP32 Wifi CLI @^0.2.1 +build_src_filter = -<*> -<*common*> + [env:freenove-tank] extends = esp32common board_build.arduino.memory_type = dio_opi ; -build_src_filter = -<*> + -lib_deps = - nanopb/Nanopb@0.4.8 +build_src_filter = -<*> + + +lib_deps = + ${esp32common.lib_deps} madhephaestus/ESP32Servo@1.1.2 https://github.com/hpsaturn/SerialTerminal.git hpsaturn/ESP32 Wifi CLI @^0.2.1 @@ -48,6 +47,7 @@ lib_deps = [m5cores3_common] extends = esp32common lib_deps = + ${esp32common.lib_deps} https://github.com/m5stack/M5CoreS3.git m5stack/M5Unified@^0.1.6 build_flags = @@ -59,32 +59,24 @@ build_flags = [env:m5cores3-espnow-sender] extends = m5cores3_common build_src_filter = -<*> + -lib_deps = - ${m5cores3_common.lib_deps} - nanopb/Nanopb@0.4.8 [env:m5cores3-espnow-receiver] extends = m5cores3_common build_src_filter = -<*> + -lib_deps = - ${m5cores3_common.lib_deps} - nanopb/Nanopb@0.4.8 [env:m5core2-espnow-receiver] extends = esp32common board = esp32dev build_src_filter = -<*> + lib_deps = + ${esp32common.lib_deps} m5stack/M5Unified@^0.1.6 - nanopb/Nanopb@0.4.8 [env:m5stickCplus-joystick-tank] extends = esp32common board = esp32dev upload_speed = 1500001 -build_src_filter = -<*> + +build_src_filter = -<*> + + lib_deps = - m5stack/M5Unified@^0.1.6 - nanopb/Nanopb@0.4.8 - https://github.com/hpsaturn/SerialTerminal.git - hpsaturn/ESP32 Wifi CLI @^0.2.1 \ No newline at end of file + ${esp32common.lib_deps} + m5stack/M5Unified@^0.1.6 \ No newline at end of file diff --git a/common/CamFreenove.cpp b/src/drivers/CamFreenove.cpp similarity index 100% rename from common/CamFreenove.cpp rename to src/drivers/CamFreenove.cpp diff --git a/common/CamFreenove.h b/src/drivers/CamFreenove.h similarity index 100% rename from common/CamFreenove.h rename to src/drivers/CamFreenove.h diff --git a/common/CamXiao.cpp b/src/drivers/CamXiao.cpp similarity index 100% rename from common/CamXiao.cpp rename to src/drivers/CamXiao.cpp diff --git a/common/CamXiao.h b/src/drivers/CamXiao.h similarity index 100% rename from common/CamXiao.h rename to src/drivers/CamXiao.h diff --git a/common/S3_Parallel16_ili9488.h b/src/drivers/S3_Parallel16_ili9488.h similarity index 100% rename from common/S3_Parallel16_ili9488.h rename to src/drivers/S3_Parallel16_ili9488.h diff --git a/common/xiao_pins.h b/src/drivers/xiao_pins.h similarity index 100% rename from common/xiao_pins.h rename to src/drivers/xiao_pins.h