lib: onoff: add a config for on-off and build conditionally

Do not build this service unconditionally.

Partial fix of #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-09-26 12:53:00 -04:00 committed by Carles Cufí
commit a81b322828
5 changed files with 12 additions and 1 deletions

View file

@ -15,6 +15,7 @@ menuconfig CLOCK_CONTROL_NRF
default y default y
depends on DT_HAS_NORDIC_NRF_CLOCK_ENABLED depends on DT_HAS_NORDIC_NRF_CLOCK_ENABLED
select NRFX_CLOCK if !CLOCK_CONTROL_NRF_FORCE_ALT select NRFX_CLOCK if !CLOCK_CONTROL_NRF_FORCE_ALT
select ONOFF
help help
Enable support for the Nordic Semiconductor nRFxx series SoC clock Enable support for the Nordic Semiconductor nRFxx series SoC clock
driver. driver.

View file

@ -3,6 +3,7 @@
menuconfig REGULATOR menuconfig REGULATOR
bool "Regulator drivers" bool "Regulator drivers"
select ONOFF
help help
Include drivers for current/voltage regulators in system config Include drivers for current/voltage regulators in system config

View file

@ -14,7 +14,6 @@ zephyr_sources(
hex.c hex.c
notify.c notify.c
printk.c printk.c
onoff.c
rb.c rb.c
sem.c sem.c
thread_entry.c thread_entry.c
@ -25,6 +24,8 @@ zephyr_sources(
multi_heap.c multi_heap.c
) )
zephyr_sources_ifdef(CONFIG_ONOFF onoff.c)
zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c)
zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c)

View file

@ -38,6 +38,13 @@ config MPSC_PBUF
storing variable length packets in a circular way and operate directly storing variable length packets in a circular way and operate directly
on the buffer memory. on the buffer memory.
config ONOFF
bool "On-Off Manager"
help
An on-off manager supports an arbitrary number of clients of a
service which has a binary state. Example applications are power
rails, clocks, and binary device power management.
config SPSC_PBUF config SPSC_PBUF
bool "Single producer, single consumer packet buffer" bool "Single producer, single consumer packet buffer"
help help

View file

@ -1,3 +1,4 @@
CONFIG_POLL=y CONFIG_POLL=y
CONFIG_ZTEST=y CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_NEW_API=y
CONFIG_ONOFF=y