Skip to content
Commit c0978727 authored by Andrzej Głąbek's avatar Andrzej Głąbek Committed by Carles Cufí
Browse files

include: drivers: adc: Refactor the ADC_CHANNEL_CFG_DT() macro



Add a default value (0) used for the `input_positive` field of the
`adc_channel_cfg` structure when there is no `input-positive` property
specified in the DT node for a given channel.
This solves a problem that occurs when an ADC driver that requires
analog inputs to be specified (so it selects ADC_CONFIGURABLE_INPUTS)
is used together with an ADC driver that does not use the corresponding
fields of the `adc_channel_cfg` structure. With the previous form of
the macro, the DT nodes with channel configuration for the latter
driver would need to specify the `input-positive` property, though its
value would be ignored, otherwise a build error would occur.

Signed-off-by: default avatarAndrzej Głąbek <andrzej.glabek@nordicsemi.no>
parent 9a7ed58b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment