summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorSean Cross <[email protected]>2019-11-20 17:45:21 +0800
committerSean Cross <[email protected]>2019-11-20 17:45:21 +0800
commita9282eab51e7342cb464fcf995d8612ee606357c (patch)
treee4e5e62a4fb21102e38810c6a42405c1a04f3247 /src/portable
parentc2fb813658d6242dbea13d9f811482e34cd712c0 (diff)
eptri: clear proper endpoint when opening IN port
When opening a USB port, we ensure the buffer is NULL and has a length of 0. Due to a mistake in specifying the endpoint type, we never actually cleared the value when opening an IN endpoint. This patch fixes the comparison when opening an IN endpoint. This fixes issue #218. Signed-off-by: Sean Cross <[email protected]>
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/valentyusb/eptri/dcd_eptri.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/portable/valentyusb/eptri/dcd_eptri.c b/src/portable/valentyusb/eptri/dcd_eptri.c
index d7e1b8a9a..e555fb0b1 100644
--- a/src/portable/valentyusb/eptri/dcd_eptri.c
+++ b/src/portable/valentyusb/eptri/dcd_eptri.c
@@ -415,7 +415,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
rx_buffer[ep_num] = NULL;
}
- else if (ep_dir == TUSB_DIR_OUT) {
+ else if (ep_dir == TUSB_DIR_IN) {
tx_buffer_offset[ep_num] = 0;
tx_buffer_max[ep_num] = 0;
tx_buffer[ep_num] = NULL;