Skip to content

Commit 97e4675

Browse files
nordic-krchnordicjm
authored andcommitted
[nrf fromlist] samples: drivers: adc: adc_sequence: Do not overwrite vref_mv
Sample is reading vref-mv property to get reference voltage and then if reference source is set to ADC_REF_INTERNAL this value is overwritten. If vref-mv property is provided then it should not be overwritten. Upstream PR #: 87405 Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 03986a4 commit 97e4675

File tree

1 file changed

+1
-1
lines changed
  • samples/drivers/adc/adc_sequence/src

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main(void)
6060
printf("Could not setup channel #%d (%d)\n", i, err);
6161
return 0;
6262
}
63-
if (channel_cfgs[i].reference == ADC_REF_INTERNAL) {
63+
if ((vrefs_mv[i] == 0) && (channel_cfgs[i].reference == ADC_REF_INTERNAL)) {
6464
vrefs_mv[i] = adc_ref_internal(adc);
6565
}
6666
}

0 commit comments

Comments
 (0)