From cfed3ed6e95e20c42101ab951660274a1cc1ee28 Mon Sep 17 00:00:00 2001 From: azeemshatp Date: Tue, 26 May 2020 12:52:55 +0100 Subject: [PATCH] Configure custom data nodes --- boards/Kconfig | 5 +++++ src/data_nodes.cpp | 2 +- zephyr/CMakeLists.txt | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/boards/Kconfig b/boards/Kconfig index 5e0edee..d9c3c6d 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -29,6 +29,11 @@ config LIBRE_SOLAR_TYPE_ID help Numeric Libre Solar hardware type ID +config CUSTOM_DATA_NODES_FILE + bool + default n + help + Use the custom made data_nodes file # # Visible (user-configurable) Kconfig symbols diff --git a/src/data_nodes.cpp b/src/data_nodes.cpp index 6680850..bc86ab8 100644 --- a/src/data_nodes.cpp +++ b/src/data_nodes.cpp @@ -22,7 +22,7 @@ // can be used to configure custom data objects in separate file instead // (e.g. data_nodes_custom.cpp) -#ifndef CUSTOM_DATA_NODES_FILE +#ifndef CONFIG_CUSTOM_DATA_NODES_FILE #include "thingset.h" #include "hardware.h" diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index b771523..eece7da 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -12,6 +12,8 @@ add_definitions(-D__ZEPHYR__ -DDEBUG_PRINT_FLAGS=7) include_directories(../src) +target_sources_if_kconfig(CONFIG_CUSTOM_DATA_NODES_FILE, app PRIVATE ../src/data_nodes_custom.cpp) + target_sources(app PRIVATE ../src/bat_charger.cpp ../src/data_nodes.cpp