Skip to content

Commit f0222a4

Browse files
natto1784jhedberg
authored andcommitted
samples: adc_stream: fix sample filter
io-channels in zephyr,user is required for this sample to compile, so add that to the filter and remove the redundant ifdef in the source code. Signed-off-by: Amneesh Singh <[email protected]>
1 parent 3dc72db commit f0222a4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

samples/drivers/adc/adc_stream/sample.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ sample:
22
name: ADC stream sample
33
common:
44
tags: adc
5+
depends_on: adc
6+
filter: dt_alias_exists("adc0") and dt_node_has_prop("/zephyr,user","io-channels")
57
harness: console
68
harness_config:
79
type: one_line
810
regex:
911
- "^ADC data for [^@]+@\\d+ \\([0-9.]+\\) \\d+n$"
1012
tests:
11-
sample.driver.adc_stream:
12-
filter: dt_alias_exists("adc0")
13+
sample.driver.adc_stream: {}
1314
sample.driver.adc_stream.ad4052-stream:
1415
extra_args:
1516
- SHIELD=eval_ad4052_ardz

samples/drivers/adc/adc_stream/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919

2020
#define SAMPLE_DT_SPEC_AND_COMMA(node_id, prop, idx) ADC_DT_SPEC_GET_BY_IDX(node_id, idx),
2121

22-
#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels)
2322
/* Data of ADC io-channels specified in devicetree. */
2423
static const struct adc_dt_spec adc_channels[] = {
2524
DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), io_channels, SAMPLE_DT_SPEC_AND_COMMA)
2625
};
2726
static const int adc_channels_count = ARRAY_SIZE(adc_channels);
28-
#endif
2927

3028
static void init_adc(void)
3129
{

0 commit comments

Comments
 (0)