diff options
-rw-r--r-- | common/usb_pd_tcpc.c | 4 | ||||
-rw-r--r-- | test/usb_pd.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index 99e3470e18..a540d6f67f 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -362,9 +362,11 @@ static int send_validate_message(int port, uint16_t header, static uint32_t payload[7]; uint8_t expected_msg_id = PD_HEADER_ID(header); uint8_t cnt = PD_HEADER_CNT(header); + int retries = PD_HEADER_TYPE(header) == PD_DATA_SOURCE_CAP ? + 0 : PD_RETRY_COUNT; /* retry 3 times if we are not getting a valid answer */ - for (r = 0; r <= PD_RETRY_COUNT; r++) { + for (r = 0; r <= retries; r++) { int bit_len, head; /* write the encoded packet in the transmission buffer */ bit_len = prepare_message(port, header, cnt, data); diff --git a/test/usb_pd.c b/test/usb_pd.c index 80c5d10885..7133af28e9 100644 --- a/test/usb_pd.c +++ b/test/usb_pd.c @@ -618,8 +618,14 @@ static int test_sink(void) TEST_ASSERT(pd_test_tx_msg_verify_crc(port)); TEST_ASSERT(pd_test_tx_msg_verify_eop(port)); + /* Wake from pd_start_tx */ + task_wake(PD_PORT_TO_TASK_ID(port)); + usleep(30 * MSEC); + /* Looks good. Ack the source cap. */ simulate_goodcrc(port, PD_ROLE_SINK, pd_port[port].msg_tx_id); + + /* Wake from pd_rx_start */ task_wake(PD_PORT_TO_TASK_ID(port)); usleep(30 * MSEC); inc_tx_id(port); |