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. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
2f7d799c99
commit
2174e1690a
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ int main(void)
|
|||
printf("Could not setup channel #%d (%d)\n", i, err);
|
||||
return 0;
|
||||
}
|
||||
if (channel_cfgs[i].reference == ADC_REF_INTERNAL) {
|
||||
if ((vrefs_mv[i] == 0) && (channel_cfgs[i].reference == ADC_REF_INTERNAL)) {
|
||||
vrefs_mv[i] = adc_ref_internal(adc);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue