From 3c0555933456597ee1c3cdff9eaeec62e19d0614 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Wed, 30 Jul 2014 16:52:06 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/210559 Reviewed-by: Vincent Palatin --- common/usb_pd_protocol.c | 3 +-- 1 file changed, 1 insertion(+), 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 */