feat(refactor): Restructure project for improved modularity and clarity
This commit introduces a major refactoring of the project structure to align with Zephyr's recommended multi-application and library organization. Key changes include: - Relocation of custom modules from 'software/modules/' to 'software/lib/'. - Introduction of a central 'software/CMakeLists.txt' to manage application and library subdirectories. - Creation of new Kconfig files for 'software/' and 'software/apps/slave_node/' to define project-wide and application-specific configurations. - Removal of the 'gateway' and 'stm32g431_tests' applications. - Removal of 'shell_modbus.c' and 'shell_system.c' from 'slave_node' application's direct source files, indicating a shift towards library-based shell commands. - Updates to 'software/apps/slave_node/CMakeLists.txt', 'prj.conf', and 'boards/bluepill_f103rb.conf' to reflect the new structure and dependencies.
This commit is contained in:
@@ -1,27 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Point BOARD_ROOT and DTS_ROOT to the 'software' directory, which contains 'boards'.
|
||||
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(slave_node)
|
||||
|
||||
list(APPEND KCONFIG_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../modules/modbus_server/Kconfig)
|
||||
list(APPEND KCONFIG_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/Kconfig)
|
||||
list(APPEND KCONFIG_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../modules/fwu/Kconfig)
|
||||
|
||||
target_include_directories(app PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/modbus_server/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/fwu/include
|
||||
)
|
||||
|
||||
# Add the source files from the app and the libraries
|
||||
target_sources(app PRIVATE
|
||||
src/main.c
|
||||
src/shell_modbus.c
|
||||
src/shell_system.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/src/valve.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/modbus_server/src/modbus_server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/fwu/src/fwu.c
|
||||
)
|
||||
project(slave_node LANGUAGES C)
|
||||
zephyr_include_directories(../../include)
|
||||
add_subdirectory(../../lib lib)
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
Reference in New Issue
Block a user