Skip to content

Commit 95712bd

Browse files
erwangonashif
authored andcommitted
samples/drivers/adc: Few fixes for use with twister
Add some changes to adc sample to enable valid verdict generation using twister: -Replace 'single_line' keyword with correct 'one_line' -Remove parenthesis from the sample output to enable regex verdict -Add timeout to save time in execution Additionally, add support for disco_l475_iot1. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 6a01230 commit 95712bd

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2020 Linaro Limited
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
/* adjust channel number according to pinmux in board.dts */
10+
io-channels = <&adc1 5>;
11+
};
12+
};

samples/drivers/adc/sample.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ tests:
44
sample.drivers.adc:
55
tags: ADC
66
depends_on: adc
7-
platform_allow: nucleo_l073rz
7+
platform_allow: nucleo_l073rz disco_l475_iot1
88
harness: console
9+
timeout: 10
910
harness_config:
10-
type: single_line
11+
type: one_line
1112
regex:
12-
- "ADC reading(s): (.*)"
13+
- "ADC reading: (.*)"

samples/drivers/adc/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void main(void)
9898
return;
9999
}
100100

101-
printk("ADC reading(s):");
101+
printk("ADC reading:");
102102
for (uint8_t i = 0; i < ADC_NUM_CHANNELS; i++) {
103103
int32_t raw_value = sample_buffer[i];
104104

0 commit comments

Comments
 (0)