Kconfig: Source Kconfig from Zephyr application directory.
Enable application specific configuration to be easily included and manageable via Kconfig. Add sample. Signed-off-by: Michał Kruszewski <mkru@protonmail.com>
This commit is contained in:
parent
a6b37b072b
commit
83edd615ca
8 changed files with 42 additions and 0 deletions
|
@ -28,6 +28,12 @@ source "ext/Kconfig"
|
|||
|
||||
source "tests/Kconfig"
|
||||
|
||||
config PROJECT_BASE
|
||||
string
|
||||
option env="PROJECT_BASE"
|
||||
|
||||
source "$PROJECT_BASE/Kconfig"
|
||||
|
||||
#
|
||||
# The following are for Kconfig files for default values only.
|
||||
# These should be parsed at the end.
|
||||
|
|
5
samples/application_development/app_kconfig/Kconfig
Normal file
5
samples/application_development/app_kconfig/Kconfig
Normal file
|
@ -0,0 +1,5 @@
|
|||
menu "APPLICATION CONFIGURATION"
|
||||
|
||||
source "$PROJECT_BASE/src/Kconfig"
|
||||
|
||||
endmenu
|
4
samples/application_development/app_kconfig/Makefile
Normal file
4
samples/application_development/app_kconfig/Makefile
Normal file
|
@ -0,0 +1,4 @@
|
|||
BOARD ?= qemu_x86
|
||||
CONF_FILE = prj.conf
|
||||
|
||||
include ${ZEPHYR_BASE}/Makefile.test
|
1
samples/application_development/app_kconfig/prj.conf
Normal file
1
samples/application_development/app_kconfig/prj.conf
Normal file
|
@ -0,0 +1 @@
|
|||
# nothing here
|
6
samples/application_development/app_kconfig/src/Kconfig
Normal file
6
samples/application_development/app_kconfig/src/Kconfig
Normal file
|
@ -0,0 +1,6 @@
|
|||
config MERGE_PATCH
|
||||
bool "Merge patch"
|
||||
default y
|
||||
help
|
||||
Will this patch, supporting application
|
||||
Kconfig configuration, be merged?
|
1
samples/application_development/app_kconfig/src/Makefile
Normal file
1
samples/application_development/app_kconfig/src/Makefile
Normal file
|
@ -0,0 +1 @@
|
|||
obj-y = main.o
|
15
samples/application_development/app_kconfig/src/main.c
Normal file
15
samples/application_development/app_kconfig/src/main.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <misc/printk.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#if defined(CONFIG_MERGE_PATCH)
|
||||
printk("This patch will be merged!\n");
|
||||
#else
|
||||
printk("This patch will not be merged!\n");
|
||||
#endif
|
||||
}
|
4
samples/application_development/app_kconfig/testcase.ini
Normal file
4
samples/application_development/app_kconfig/testcase.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[test]
|
||||
tags = appdev
|
||||
build_only = true
|
||||
platform_whitelist = qemu_x86
|
Loading…
Add table
Add a link
Reference in a new issue