Relocate and clean up application Kconfig structure

This commit is contained in:
Martin Jäger
2020-07-24 08:49:47 +02:00
parent dc85b46477
commit bbd1312fe5
12 changed files with 57 additions and 71 deletions
-5
View File
@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger / Libre Solar
# include generic charge controller Kconfig
rsource "../../Kconfig"
-5
View File
@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger / Libre Solar
# include generic charge controller Kconfig
rsource "../../Kconfig"
-5
View File
@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Martin Jäger / Libre Solar
# include generic charge controller Kconfig
rsource "../../Kconfig"
@@ -35,8 +35,7 @@ CONFIG_I2C_1=y
CONFIG_I2C_2=y
CONFIG_CAN=y
#CONFIG_CAN_1=y
CONFIG_EXT_THINGSET_CAN=y
CONFIG_THINGSET_CAN=y
CONFIG_EEPROM=y
CONFIG_EEPROM_AT24=y
-5
View File
@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Martin Jäger / Libre Solar
# include generic charge controller Kconfig
rsource "../../Kconfig"
@@ -63,7 +63,7 @@ CONFIG_EEPROM_AT24=y
# don't enable CAN by default until PR #22832 is merged to upstream Zephyr
#CONFIG_CAN=y
#CONFIG_EXT_THINGSET_CAN=y
#CONFIG_THINGSET_CAN=y
CONFIG_ISOTP=y
CONFIG_ISOTP_RX_BUF_COUNT=1
-5
View File
@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger / Libre Solar
# include generic charge controller Kconfig
rsource "../../Kconfig"
+3 -3
View File
@@ -51,7 +51,7 @@ static char auth_password[11];
bool pub_serial_enable = false;
#if CONFIG_EXT_THINGSET_CAN
#if CONFIG_THINGSET_CAN
bool pub_can_enable = false;
uint16_t ts_can_node_id = CONFIG_THINGSET_CAN_DEFAULT_NODE_ID;
#endif
@@ -200,7 +200,7 @@ static DataNode data_nodes[] = {
ID_CONF, TS_ANY_R | TS_ANY_W, PUB_NVM),
#endif
#if CONFIG_EXT_THINGSET_CAN
#if CONFIG_THINGSET_CAN
TS_NODE_UINT16(0x59, "CanNodeId", &ts_can_node_id,
ID_CONF, TS_ANY_R | TS_ANY_W, PUB_NVM),
#endif
@@ -460,7 +460,7 @@ static DataNode data_nodes[] = {
TS_NODE_BOOL(0xF2, "Enable", &pub_serial_enable, 0xF1, TS_ANY_RW, 0),
TS_NODE_PUBSUB(0xF3, "IDs", PUB_SER, 0xF1, TS_ANY_RW, 0),
#if CONFIG_EXT_THINGSET_CAN
#if CONFIG_THINGSET_CAN
TS_NODE_PATH(0xF5, "can", ID_PUB, NULL),
TS_NODE_BOOL(0xF6, "Enable", &pub_can_enable, 0xF5, TS_ANY_RW, 0),
TS_NODE_PUBSUB(0xF7, "IDs", PUB_CAN, 0xF5, TS_ANY_RW, 0),
+2 -2
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#if CONFIG_EXT_THINGSET_CAN
#if CONFIG_THINGSET_CAN
#include <zephyr.h>
#include <device.h>
@@ -164,4 +164,4 @@ void can_pub_thread()
K_THREAD_DEFINE(can_pub, 1024, can_pub_thread, NULL, NULL, NULL, 6, 0, 1000);
#endif /* CONFIG_EXT_THINGSET_CAN */
#endif /* CONFIG_THINGSET_CAN */
+4 -4
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#if CONFIG_EXT_THINGSET_SERIAL
#if CONFIG_THINGSET_SERIAL
#include <string.h>
#include <stdio.h>
@@ -21,8 +21,8 @@
struct device *uart_dev = device_get_binding(UART_DEVICE_NAME);
static char buf_resp[CONFIG_EXT_THINGSET_SERIAL_TX_BUF_SIZE];
static char buf_req[CONFIG_EXT_THINGSET_SERIAL_RX_BUF_SIZE];
static char buf_resp[CONFIG_THINGSET_SERIAL_TX_BUF_SIZE];
static char buf_req[CONFIG_THINGSET_SERIAL_RX_BUF_SIZE];
static volatile size_t req_pos = 0;
static volatile bool command_flag = false;
@@ -126,4 +126,4 @@ void serial_thread()
K_THREAD_DEFINE(serial_thread_id, 1024, serial_thread, NULL, NULL, NULL, 6, 0, 1000);
#endif /* CONFIG_EXT_THINGSET_SERIAL */
#endif /* CONFIG_THINGSET_SERIAL */
+25 -13
View File
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger (Libre Solar)
mainmenu "Libre Solar Charge Controller Firmware"
#
# Invisible (board-specific) Kconfig symbols
#
@@ -31,6 +33,8 @@ config HS_MOSFET_FAIL_SAFE_PROTECTION
# Visible (user-configurable) Kconfig symbols
#
menu "Charge Controller Setup"
choice
prompt "High-voltage terminal"
depends on $(dt_compat_enabled,dcdc)
@@ -81,7 +85,7 @@ choice
endchoice
menu "Battery configuration"
menu "Battery"
choice
prompt "Default battery cell type"
@@ -143,11 +147,13 @@ config BAT_DEFAULT_CAPACITY_AH
endmenu
endmenu # Terminal configuration
menu "Extensions and interfaces"
menu "UEXT port"
config EXT_OLED_DISPLAY
bool "OLED display at UEXT"
bool "OLED display"
config EXT_OLED_BRIGHTNESS
depends on EXT_OLED_DISPLAY
@@ -155,42 +161,45 @@ config EXT_OLED_BRIGHTNESS
range 1 255
default 1
config EXT_THINGSET_SERIAL
endmenu # UEXT port
menu "ThingSet interfaces"
config THINGSET_SERIAL
bool "ThingSet serial interface"
config EXT_THINGSET_SERIAL_RX_BUF_SIZE
depends on EXT_THINGSET_SERIAL
config THINGSET_SERIAL_RX_BUF_SIZE
depends on THINGSET_SERIAL
int "ThingSet serial RX buffer size"
range 64 2048
default 512
config EXT_THINGSET_SERIAL_TX_BUF_SIZE
depends on EXT_THINGSET_SERIAL
config THINGSET_SERIAL_TX_BUF_SIZE
depends on THINGSET_SERIAL
int "ThingSet serial TX buffer size"
range 256 2048
default 1024
config EXT_THINGSET_CAN
config THINGSET_CAN
depends on CAN
bool "ThingSet CAN interface"
config THINGSET_CAN_DEFAULT_NODE_ID
depends on EXT_THINGSET_CAN
depends on THINGSET_CAN
int "ThingSet CAN default node ID"
range 0 255
default 20
config THINGSET_EXPERT_PASSWORD
depends on EXT_THINGSET_SERIAL || EXT_THINGSET_CAN
string "ThingSet expert user password"
default "expert123"
config THINGSET_MAKER_PASSWORD
depends on EXT_THINGSET_SERIAL || EXT_THINGSET_CAN
string "ThingSet maker password"
default "maker456"
endmenu
endmenu # ThingSet interfaces
menuconfig CUSTOMIZATION
@@ -219,3 +228,6 @@ config CUSTOM_DCDC_CONTROLLER
MPPT control.
endif
# include main Zephyr menu entries from Zephyr root directory
source "Kconfig.zephyr"
+21 -21
View File
@@ -1,38 +1,38 @@
# direct printf calls to console
CONFIG_STDOUT_CONSOLE=y
# Main application configuration (overrides board-specific settings)
# default is 1024
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_CPLUSPLUS=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_BUILD_OUTPUT_BIN=y
CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=y
CONFIG_REBOOT=y
CONFIG_HWINFO=y
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_I2C=y
CONFIG_WDT_DISABLE_AT_BOOT=y
# disable log by default to save memory for STM32F0 with little RAM
CONFIG_LOG=y
CONFIG_LOG_MINIMAL=y
#CONFIG_NEWLIB_LIBC_NANO=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y
CONFIG_CPLUSPLUS=y
# direct printf calls to console
CONFIG_STDOUT_CONSOLE=y
CONFIG_HWINFO=y
CONFIG_BUILD_OUTPUT_BIN=y
# use minimal log by default to save memory for STM32F0 with little RAM
CONFIG_LOG=y
CONFIG_LOG_MINIMAL=y
# ThingSet protocol interface at UART serial
CONFIG_EXT_THINGSET_SERIAL=y
CONFIG_THINGSET_SERIAL=y
# I2C OLED display in UEXT connector
#CONFIG_EXT_OLED_DISPLAY=y
CONFIG_REBOOT=y
CONFIG_WATCHDOG=y