diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-05-01 14:56:05 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-02 22:01:57 +0000 |
commit | d2c5e22944f7eeff4b6fd3c535c76fcbce25e22e (patch) | |
tree | cae1a624720977ec39cd6d1420d849b856e08ef2 /chip/stm32 | |
parent | b40a82bc45b26f12bdb6e8fd46f2519d22ff324c (diff) | |
download | chrome-ec-d2c5e22944f7eeff4b6fd3c535c76fcbce25e22e.tar.gz |
pd: more robust reception
Ensure that we finish reception if and only if we started it
whatever other events happened.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=chrome-os-partner:28332
TEST=Connect Zinger to Firefly, request higher voltage and ensure that
Firefly was still getting the Pings after several hours.
Change-Id: Ie99984aeb4c565be39d349457dbd2813203b3f5b
Reviewed-on: https://chromium-review.googlesource.com/197946
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/stm32')
-rw-r--r-- | chip/stm32/usb_pd_phy.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c index 4417cd3f54..4a4e63b51b 100644 --- a/chip/stm32/usb_pd_phy.c +++ b/chip/stm32/usb_pd_phy.c @@ -349,6 +349,12 @@ void pd_rx_complete(void) dma_disable(DMAC_TIM_RX); } +int pd_rx_started(void) +{ + /* is the sampling timer running ? */ + return STM32_TIM_CR1(TIM_RX) & 1; +} + void pd_rx_enable_monitoring(void) { /* clear comparator external interrupt */ |