summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-10-24 17:30:01 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-25 18:20:15 +0000
commita88b23772990c4c331b12990fd337ba86fc3bf5a (patch)
treeea119a25e638b8f45425e11fd781fdbeb03511bd
parent5ef2054c38e5375da3440f1b1507dda31429c6ff (diff)
downloadchrome-ec-a88b23772990c4c331b12990fd337ba86fc3bf5a.tar.gz
stm32l: fix ADC all channels conversion
Reset the DMA status after the end of the conversions, else we will exit too early at the next call of the function and the values before they are actually transfered. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=run "adc" command several times and always see proper value for each ADC. Change-Id: I7ad335fffa2da34a4b715e9f0c9927bf06baef8f Reviewed-on: https://chromium-review.googlesource.com/174397 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/stm32/adc-stm32l.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/chip/stm32/adc-stm32l.c b/chip/stm32/adc-stm32l.c
index 2b7a789fde..0dc1d76743 100644
--- a/chip/stm32/adc-stm32l.c
+++ b/chip/stm32/adc-stm32l.c
@@ -196,6 +196,7 @@ int adc_read_all_channels(int *data)
ret = EC_ERROR_UNKNOWN;
goto exit_all_channels;
}
+ dma_clear_isr(STM32_DMAC_ADC);
for (i = 0; i < ADC_CH_COUNT; ++i) {
adc = adc_channels + i;