diff options
Diffstat (limited to 'firmware/target/arm/adc-as3514.c')
-rw-r--r-- | firmware/target/arm/adc-as3514.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/arm/adc-as3514.c b/firmware/target/arm/adc-as3514.c index 9c2a421441..77d65455fb 100644 --- a/firmware/target/arm/adc-as3514.c +++ b/firmware/target/arm/adc-as3514.c | |||
@@ -37,6 +37,18 @@ unsigned short adc_read(int channel) | |||
37 | { | 37 | { |
38 | unsigned char buf[2]; | 38 | unsigned char buf[2]; |
39 | 39 | ||
40 | /* | ||
41 | * The AS3514 ADC will trigger an interrupt when the conversion | ||
42 | * is finished, if the corresponding enable bit in IRQ_ENRD2 | ||
43 | * is set. | ||
44 | * Previously the code did not wait and this apparently did | ||
45 | * not pose any problems, but this should be more correct. | ||
46 | * Without the wait the data read back may be completely or | ||
47 | * partially (first one of the two bytes) stale. | ||
48 | */ | ||
49 | ascodec_wait_adc_finished(); | ||
50 | |||
51 | |||
40 | /* Read data */ | 52 | /* Read data */ |
41 | if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0) | 53 | if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0) |
42 | { | 54 | { |