summaryrefslogtreecommitdiff
path: root/test/usb_pd.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-10-28 14:26:51 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-17 03:27:17 +0000
commit6c980a4dbf2e37b83e868c0eb12774190ea8c94d (patch)
treeda414fe9f2f5609525ba950d5a05c54accfee475 /test/usb_pd.c
parent3b101e56a9e058aee19933f9adfae1c8bb2dbedd (diff)
downloadchrome-ec-6c980a4dbf2e37b83e868c0eb12774190ea8c94d.tar.gz
pd: check for collisions before transmitting
Added check for collision just before transmitting on CC line. To check for collision, RX monitoring is left on all the time (except when in the act of receiving or transmitting, or in between receiving and sending a goodCRC), and a simple check for RX transmission started is used to see if the CC line is idle or not. RX monitoring is also changed to only trigger on 3 edges within 20us, as per the PD spec. When a collision is detected by seeing that CC is not idle, the transmitting packet is dropped. BUG=chrome-os-partner:30135 BRANCH=samus TEST=load onto samus and zinger. make sure we negotiate and make sure custom VDMs succeed. enabled pings and made sure we stay alive with pings for a few min. Also added code to pd_rx_handler to toggle a test point on EVT board to verify the timing of when we get RX interrupts: Change-Id: I22d172163319437d3d901e019eda79d4d592f6b8 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/226118 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test/usb_pd.c')
-rw-r--r--test/usb_pd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/usb_pd.c b/test/usb_pd.c
index 2916d4eb94..9da5bfc85c 100644
--- a/test/usb_pd.c
+++ b/test/usb_pd.c
@@ -95,6 +95,7 @@ static void simulate_rx_msg(int port, uint16_t header, int cnt,
pd_test_rx_msg_append_word(port, crc32_result());
pd_test_rx_msg_append_eop(port);
+ pd_test_rx_msg_append_last_edge(port);
pd_simulate_rx(port);
}