diff options
| author | sakumisu <[email protected]> | 2022-02-17 13:32:53 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-02-17 13:32:53 +0800 |
| commit | ba3fceeb8703a68aefef01a00042b5aa07e4b9a7 (patch) | |
| tree | 0e3afe820ac1b4cc34c4e73ab1faf2a38ebaf848 | |
| parent | 97a80a599c04e852e3e57ce2dc758aeeb32e24d5 (diff) | |
fix ep0 zlp send judgement
| -rw-r--r-- | core/usbd_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/usbd_core.c b/core/usbd_core.c index 6e88ecdb..ce4e4abc 100644 --- a/core/usbd_core.c +++ b/core/usbd_core.c @@ -982,7 +982,7 @@ static void usbd_send_to_host(uint16_t len) * last chunk is wMaxPacketSize long, to indicate the last * packet. */ - if ((!usbd_core_cfg.ep0_data_buf_residue) && (usbd_core_cfg.ep0_data_buf_len >= USB_CTRL_EP_MPS) && !(usbd_core_cfg.ep0_data_buf_len % USB_CTRL_EP_MPS)) { + if(!usbd_core_cfg.ep0_data_buf_residue && (len > usbd_core_cfg.ep0_data_buf_len) && !(usbd_core_cfg.ep0_data_buf_len % USB_CTRL_EP_MPS)){ /* Transfers a zero-length packet next*/ usbd_core_cfg.zlp_flag = true; } |
