doc: kconfig: Clarify that 'depends on' works for string/int/hex
Seems people are a bit hazy on this, so explain how it works. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
344d4bdce0
commit
7c8bcf0772
1 changed files with 25 additions and 0 deletions
|
@ -326,6 +326,31 @@ error-prone, since it can be hard to spot that the same dependency is added
|
||||||
twice.
|
twice.
|
||||||
|
|
||||||
|
|
||||||
|
``depends on`` and ``string``/``int``/``hex`` symbols
|
||||||
|
*****************************************************
|
||||||
|
|
||||||
|
``depends on`` works not just for ``bool`` symbols, but also for ``string``,
|
||||||
|
``int``, and ``hex`` symbols (and for choices).
|
||||||
|
|
||||||
|
The Kconfig definitions below will hide the ``FOO_DEVICE_FREQUENCY`` symbol and
|
||||||
|
disable any configuration output for it when ``FOO_DEVICE`` is disabled.
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
config FOO_DEVICE
|
||||||
|
bool "Foo device"
|
||||||
|
|
||||||
|
config FOO_DEVICE_FREQUENCY
|
||||||
|
int "Foo device frequency"
|
||||||
|
depends on FOO_DEVICE
|
||||||
|
|
||||||
|
In general, it's a good idea to check that only relevant symbols are ever shown
|
||||||
|
in the ``menuconfig`` interface. Having ``FOO_DEVICE_FREQUENCY`` show up when
|
||||||
|
``FOO_DEVICE`` is disabled (and possibly hidden) makes the relationship between
|
||||||
|
the symbols harder to understand, even if code never looks at
|
||||||
|
``FOO_DEVICE_FREQUENCY`` when ``FOO_DEVICE`` is disabled.
|
||||||
|
|
||||||
|
|
||||||
Checking changes in ``menuconfig``
|
Checking changes in ``menuconfig``
|
||||||
**********************************
|
**********************************
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue