diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-07-30 16:52:06 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-31 04:37:27 +0000 |
commit | 3c0555933456597ee1c3cdff9eaeec62e19d0614 (patch) | |
tree | 4e206e5d445f28c29506fb9016bd35a18aecc932 | |
parent | d5aaf91a7ae17cc608f23835a99e415e648c42ff (diff) | |
download | chrome-ec-3c0555933456597ee1c3cdff9eaeec62e19d0614.tar.gz |
pd: fix transmit bug, add back in retry mechanism
Fix bug in pd transmission. The retry mechanism was not working right
and was causing us to not do any retries.
BUG=none
BRANCH=none
TEST=Test with a zinger unplugged from the wall. Samus sends source
cap and doesn't get a response. Verify on console printout that we
retried 3 times.
Change-Id: Id273bf054655c2d24a791f4eaf4cb8d87253abe2
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210559
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 2d0e1962d9..e496e3e821 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -328,8 +328,7 @@ static int send_validate_message(int port, uint16_t header, /* retry 3 times if we are not getting a valid answer */ for (r = 0; r <= PD_RETRY_COUNT; r++) { - int bit_len; - uint16_t head; + int bit_len, head; /* write the encoded packet in the transmission buffer */ bit_len = prepare_message(port, header, cnt, data); /* Transmit the packet */ |