From a5bd666f4e1c887b0cf05738d017d7fb024997bb Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 26 Sep 2022 12:48:02 -0400 Subject: [PATCH] lib: notify: build sys-notify conditionally. Add a new Kconfig and build this code conditionally, so we do not end up with this file being built for each zephyr app. Partial fix for #50654 Signed-off-by: Anas Nashif --- drivers/counter/Kconfig.maxim_ds3231 | 1 + lib/os/CMakeLists.txt | 2 +- lib/os/Kconfig | 6 ++++++ tests/lib/notify/prj.conf | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/counter/Kconfig.maxim_ds3231 b/drivers/counter/Kconfig.maxim_ds3231 index 5675c6def4d..780f252deeb 100644 --- a/drivers/counter/Kconfig.maxim_ds3231 +++ b/drivers/counter/Kconfig.maxim_ds3231 @@ -9,5 +9,6 @@ config COUNTER_MAXIM_DS3231 depends on DT_HAS_MAXIM_DS3231_ENABLED depends on I2C select POLL + select NOTIFY help Enable counter driver based on Maxim DS3231 I2C device. diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index 0101a9cad1a..f34c83e649d 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -12,7 +12,6 @@ zephyr_sources( dec.c fdtable.c hex.c - notify.c printk.c rb.c sem.c @@ -25,6 +24,7 @@ zephyr_sources( ) zephyr_sources_ifdef(CONFIG_ONOFF onoff.c) +zephyr_sources_ifdef(CONFIG_NOTIFY notify.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c) diff --git a/lib/os/Kconfig b/lib/os/Kconfig index c531f476598..57d0a680ffa 100644 --- a/lib/os/Kconfig +++ b/lib/os/Kconfig @@ -16,6 +16,11 @@ config RING_BUFFER buffers manage their own buffer memory and can store arbitrary data. For optimal performance, use buffer sizes that are a power of 2. +config NOTIFY + bool "Asynchronous Notifications" + help + Use this API to support async transactions. + config BASE64 bool "Base64 encoding and decoding" help @@ -40,6 +45,7 @@ config MPSC_PBUF config ONOFF bool "On-Off Manager" + select NOTIFY help An on-off manager supports an arbitrary number of clients of a service which has a binary state. Example applications are power diff --git a/tests/lib/notify/prj.conf b/tests/lib/notify/prj.conf index 490385d6ee4..ef6676e85d1 100644 --- a/tests/lib/notify/prj.conf +++ b/tests/lib/notify/prj.conf @@ -1,3 +1,4 @@ CONFIG_POLL=y CONFIG_ZTEST=y CONFIG_ZTEST_NEW_API=y +CONFIG_NOTIFY=y