Skip to content

Commit

Permalink
drivers: adc: fix IF_ENABLED macro usage in ADS1X1X trigger
Browse files Browse the repository at this point in the history
The ADC_ADS1X1X_TRIGGER macro was defined without an explicit value,
preventing ALERT/RDY pin configuration even when alert_rdy_gpios
were properly defined in devicetree. This occurred because
the IF_ENABLED macro specifically requires macros to be defined as 1,
not just defined empty.

Fixed this by explicitly defining ADC_ADS1X1X_TRIGGER as 1 when
alert_rdy_gpios properties are present in devicetree.

Signed-off-by: Benjamin Geiger <[email protected]>
  • Loading branch information
Benni77 authored and kartben committed Dec 12, 2024
1 parent af9ae5b commit 2ed8790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/adc/adc_ads1x1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LOG_MODULE_REGISTER(ADS1X1X, CONFIG_ADC_LOG_LEVEL);
DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(ti_ads1015, alert_rdy_gpios) || \
DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(ti_ads1014, alert_rdy_gpios)

#define ADC_ADS1X1X_TRIGGER
#define ADC_ADS1X1X_TRIGGER 1

#endif

Expand Down

0 comments on commit 2ed8790

Please sign in to comment.