Refactor fwu library into a Zephyr module
This commit is contained in:
@@ -4,3 +4,4 @@ project(software)
|
|||||||
|
|
||||||
add_subdirectory(modules/modbus_server)
|
add_subdirectory(modules/modbus_server)
|
||||||
add_subdirectory(modules/valve)
|
add_subdirectory(modules/valve)
|
||||||
|
add_subdirectory(modules/fwu)
|
||||||
|
|||||||
@@ -6,10 +6,14 @@ list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
|||||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(slave_node)
|
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
|
target_include_directories(app PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/modbus_server/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/modbus_server/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/fwu
|
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/fwu/include
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add the source files from the app and the libraries
|
# Add the source files from the app and the libraries
|
||||||
@@ -19,5 +23,5 @@ target_sources(app PRIVATE
|
|||||||
src/shell_system.c
|
src/shell_system.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/valve/src/valve.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/modbus_server/src/modbus_server.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/fwu/fwu.c
|
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/fwu/src/fwu.c
|
||||||
)
|
)
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
#include <modbus_server.h>
|
#include <modbus_server.h>
|
||||||
#include <valve.h>
|
#include <valve.h>
|
||||||
#include "fwu.h"
|
#include <fwu.h>
|
||||||
|
|
||||||
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
|
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
|
||||||
|
|
||||||
|
|||||||
7
software/modules/fwu/CMakeLists.txt
Normal file
7
software/modules/fwu/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13.1)
|
||||||
|
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||||
|
|
||||||
|
project(fwu)
|
||||||
|
|
||||||
|
target_sources(app PRIVATE src/fwu.c)
|
||||||
|
target_include_directories(app PUBLIC include)
|
||||||
5
software/modules/fwu/Kconfig
Normal file
5
software/modules/fwu/Kconfig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
config FWU
|
||||||
|
bool "Enable Firmware Update Library"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable the Firmware Update module.
|
||||||
Reference in New Issue
Block a user