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 <erwan.gouriou@linaro.org>
This commit is contained in:
parent
6a012301e6
commit
95712bd498
3 changed files with 17 additions and 4 deletions
12
samples/drivers/adc/boards/disco_l475_iot1.overlay
Normal file
12
samples/drivers/adc/boards/disco_l475_iot1.overlay
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2020 Linaro Limited
|
||||
*/
|
||||
|
||||
/ {
|
||||
zephyr,user {
|
||||
/* adjust channel number according to pinmux in board.dts */
|
||||
io-channels = <&adc1 5>;
|
||||
};
|
||||
};
|
|
@ -4,9 +4,10 @@ tests:
|
|||
sample.drivers.adc:
|
||||
tags: ADC
|
||||
depends_on: adc
|
||||
platform_allow: nucleo_l073rz
|
||||
platform_allow: nucleo_l073rz disco_l475_iot1
|
||||
harness: console
|
||||
timeout: 10
|
||||
harness_config:
|
||||
type: single_line
|
||||
type: one_line
|
||||
regex:
|
||||
- "ADC reading(s): (.*)"
|
||||
- "ADC reading: (.*)"
|
||||
|
|
|
@ -98,7 +98,7 @@ void main(void)
|
|||
return;
|
||||
}
|
||||
|
||||
printk("ADC reading(s):");
|
||||
printk("ADC reading:");
|
||||
for (uint8_t i = 0; i < ADC_NUM_CHANNELS; i++) {
|
||||
int32_t raw_value = sample_buffer[i];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue