move things around
This commit is contained in:
3
firmware/lib/CMakeLists.txt
Normal file
3
firmware/lib/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_CUSTOM custom)
|
8
firmware/lib/Kconfig
Normal file
8
firmware/lib/Kconfig
Normal file
@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 Legrand North America, LLC.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menu "Custom libraries"
|
||||
|
||||
rsource "custom/Kconfig"
|
||||
|
||||
endmenu
|
5
firmware/lib/custom/CMakeLists.txt
Normal file
5
firmware/lib/custom/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# Copyright (c) 2021, Legrand North America, LLC.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources(custom.c)
|
19
firmware/lib/custom/Kconfig
Normal file
19
firmware/lib/custom/Kconfig
Normal file
@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2021, Legrand North America, LLC.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config CUSTOM
|
||||
bool "Support for custom library"
|
||||
help
|
||||
This option enables the 'custom' library
|
||||
|
||||
config CUSTOM_GET_VALUE_DEFAULT
|
||||
int "custom_get_value() default return value"
|
||||
depends on CUSTOM
|
||||
default 0
|
||||
help
|
||||
This option primarily exists as an example of a library Kconfig
|
||||
setting.
|
||||
|
||||
This option specifies the value for custom_get_value() to return
|
||||
when the input parameter is zero. (Otherwise the function returns the
|
||||
input parameter value.)
|
12
firmware/lib/custom/custom.c
Normal file
12
firmware/lib/custom/custom.c
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Legrand North America, LLC.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <app/lib/custom.h>
|
||||
|
||||
int custom_get_value(int val)
|
||||
{
|
||||
return (val != 0) ? val : CONFIG_CUSTOM_GET_VALUE_DEFAULT;
|
||||
}
|
Reference in New Issue
Block a user