Skip to content

Commit 0b00493

Browse files
Niranjhana NMaureenHelm
authored andcommitted
tests: drivers: adc: fix failing test for frdm_k64f
This test is failing for the frdm platform because the ADC_DEVICE_NAME is different. Add #if statements to correct for respective platform names. Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
1 parent 8f6ebc5 commit 0b00493

File tree

1 file changed

+20
-2
lines changed
  • tests/drivers/adc/adc_simple/src

1 file changed

+20
-2
lines changed

tests/drivers/adc/adc_simple/src/main.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,25 @@
1919
/* in millisecond */
2020
#define SLEEPTIME 2000
2121

22-
#define ADC_DEVICE_NAME "ADC_0"
22+
#if defined(CONFIG_BOARD_FRDM_K64F)
23+
#define ADC_DEVICE_NAME CONFIG_ADC_1_NAME
24+
#define CHANNEL 14
25+
#elif defined(CONFIG_BOARD_FRDM_KL25Z)
26+
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
27+
#define CHANNEL 12
28+
#elif defined(CONFIG_BOARD_FRDM_KW41Z)
29+
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
30+
#define CHANNEL 3
31+
#elif defined(CONFIG_BOARD_HEXIWEAR_K64)
32+
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
33+
#define CHANNEL 16
34+
#elif defined(CONFIG_BOARD_HEXIWEAR_KW40Z)
35+
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
36+
#define CHANNEL 1
37+
#else
38+
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
39+
#define CHANNEL 10
40+
#endif
2341

2442
/*
2543
* The analog input pin and channel number mapping
@@ -30,7 +48,7 @@
3048
* A3 Channel 13
3149
* A4 Channel 14
3250
*/
33-
#define CHANNEL 10
51+
3452
#define BUFFER_SIZE 10
3553

3654
static u32_t seq_buffer[2][BUFFER_SIZE];

0 commit comments

Comments
 (0)