reorganize project structure

This commit is contained in:
2026-02-14 19:05:26 -06:00
parent e3090bf1f5
commit 532d93d5d7
19 changed files with 60 additions and 16 deletions

View File

@@ -5,7 +5,11 @@ set(PROJECT_MAIN_COMPONENT ${CMAKE_CURRENT_LIST_DIR}/src)
set(EXTRA_COMPONENT_DIRS set(EXTRA_COMPONENT_DIRS
${CMAKE_CURRENT_LIST_DIR}/config ${CMAKE_CURRENT_LIST_DIR}/config
${CMAKE_CURRENT_LIST_DIR}/src ${CMAKE_CURRENT_LIST_DIR}/src/drivers
${CMAKE_CURRENT_LIST_DIR}/src/main
${CMAKE_CURRENT_LIST_DIR}/src/tasks
${CMAKE_CURRENT_LIST_DIR}/src/ssd
${CMAKE_CURRENT_LIST_DIR}/src/wsled
) )
# For the esp-idf configuration # For the esp-idf configuration

View File

@@ -2,13 +2,11 @@
file(GLOB SRC_FILES file(GLOB SRC_FILES
"*.c" "*.c"
"*.cpp" "*.cpp"
"drivers/*.c"
) )
idf_component_register( idf_component_register(
SRCS ${SRC_FILES} SRCS ${SRC_FILES}
PRIV_REQUIRES spi_flash PRIV_REQUIRES spi_flash
REQUIRES esp_driver_gpio REQUIRES esp_driver_gpio esp_driver_spi
REQUIRES esp_driver_spi
INCLUDE_DIRS "." INCLUDE_DIRS "."
) )

View File

@@ -7,7 +7,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "pins.hpp" #include "shared/pins.h"
#include "DemoTask.hpp" #include "DemoTask.hpp"

View File

@@ -3,6 +3,7 @@
#include<stdint.h> #include<stdint.h>
// This class is for managing tasks
class App { class App {
public: public:
@@ -13,9 +14,7 @@ public:
uint32_t main(); uint32_t main();
private: private:
uint32_t ledState = 0;
uint32_t blinkTime = 250;
const char *TAG = "app"; // TODO: instead of this for logging you can use __FILE__ or __func__ const char *TAG = "app"; // TODO: instead of this for logging you can use __FILE__ or __func__
}; };

10
src/main/CMakeLists.txt Normal file
View File

@@ -0,0 +1,10 @@
file(GLOB SRC_FILES
"*.c"
"*.cpp"
)
idf_component_register(
SRCS ${SRC_FILES}
INCLUDE_DIRS "." ".."
)

12
src/ssd/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
file(GLOB SRC_FILES
"*.c"
"*.cpp"
)
idf_component_register(
SRCS ${SRC_FILES}
PRIV_REQUIRES spi_flash
REQUIRES esp_driver_gpio esp_driver_spi
INCLUDE_DIRS "." ".."
)

View File

@@ -4,7 +4,7 @@
#include "stdint.h" #include "stdint.h"
#include "drivers/ssd.h" #include "drivers/ssd.h"
#include "common.h" #include "shared/common.h"
class SsdInterface { class SsdInterface {

12
src/tasks/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
file(GLOB SRC_FILES
"*.c"
"*.cpp"
)
idf_component_register(
SRCS ${SRC_FILES}
PRIV_REQUIRES spi_flash
REQUIRES esp_driver_gpio esp_driver_spi
INCLUDE_DIRS "." ".."
)

View File

@@ -1,14 +1,11 @@
#include "DemoTask.hpp" #include "DemoTask.hpp"
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "SsdInterface.hpp" #include "ssd/SsdInterface.hpp"
#include "WsledInterface.hpp" #include "wsled/WsledInterface.hpp"
#include "pins.hpp" #include "shared/pins.h"
DemoTask::DemoTask() { DemoTask::DemoTask() {

12
src/wsled/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
file(GLOB SRC_FILES
"*.c"
"*.cpp"
)
idf_component_register(
SRCS ${SRC_FILES}
PRIV_REQUIRES spi_flash
REQUIRES esp_driver_gpio esp_driver_spi
INCLUDE_DIRS "." ".."
)

View File

@@ -4,7 +4,7 @@
#include "stdint.h" #include "stdint.h"
#include "drivers/wsled.h" #include "drivers/wsled.h"
#include "common.h" #include "shared/common.h"
class WsledInterface { class WsledInterface {