From ad242b9db85c86cb6d5de52111eea462926467c5 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Mon, 29 Jan 2024 22:17:22 +0100 Subject: [PATCH] samples: modules: nanopb: Showcase configuring options The latest version of nanopb allows for using kconfig symbols in files with an "options.in" extension. Signed-off-by: Pieter De Gendt --- samples/modules/nanopb/Kconfig | 14 ++++++++++++++ samples/modules/nanopb/src/simple.options | 1 - samples/modules/nanopb/src/simple.options.in | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 samples/modules/nanopb/Kconfig delete mode 100644 samples/modules/nanopb/src/simple.options create mode 100644 samples/modules/nanopb/src/simple.options.in diff --git a/samples/modules/nanopb/Kconfig b/samples/modules/nanopb/Kconfig new file mode 100644 index 00000000000..8e91baf5174 --- /dev/null +++ b/samples/modules/nanopb/Kconfig @@ -0,0 +1,14 @@ +# Private config options for nanopb app + +# Copyright (c) 2024 Basalte bv +# SPDX-License-Identifier: Apache-2.0 + +mainmenu "Nanopb protobuf sample application" + +config SAMPLE_BUFFER_SIZE + int "Simple message buffer size" + default 8 + help + Configure the simple message buffer field's size. + +source "Kconfig.zephyr" diff --git a/samples/modules/nanopb/src/simple.options b/samples/modules/nanopb/src/simple.options deleted file mode 100644 index 47c1f05de08..00000000000 --- a/samples/modules/nanopb/src/simple.options +++ /dev/null @@ -1 +0,0 @@ -SimpleMessage.buffer max_size:8 fixed_length:true diff --git a/samples/modules/nanopb/src/simple.options.in b/samples/modules/nanopb/src/simple.options.in new file mode 100644 index 00000000000..7089a0a08c0 --- /dev/null +++ b/samples/modules/nanopb/src/simple.options.in @@ -0,0 +1 @@ +SimpleMessage.buffer max_size:@CONFIG_SAMPLE_BUFFER_SIZE@ fixed_length:true