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>
This commit is contained in:
Alec Berg
2014-07-30 16:52:06 -07:00
committed by chrome-internal-fetch
parent d5aaf91a7a
commit 3c05559334

View File

@@ -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 */