Skip to content

Commit dc2597d

Browse files
committed
ZLP handling for composite test device
1 parent 48c633b commit dc2597d

File tree

7 files changed

+5
-0
lines changed

7 files changed

+5
-0
lines changed
24 Bytes
Binary file not shown.
24 Bytes
Binary file not shown.
24 Bytes
Binary file not shown.

test-devices/composite-stm32/src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ void cust_vendor_tx_cb(uint8_t ep_addr, uint32_t sent_bytes) {
129129

130130
loopback_check_tx();
131131
loopback_check_rx();
132+
133+
// check ZLP
134+
if ((sent_bytes & (BULK_MAX_PACKET_SIZE - 1)) == 0
135+
&& !cust_vendor_is_transmitting(ep_addr))
136+
cust_vendor_start_transmit(EP_LOOPBACK_TX, NULL, 0);
132137
}
133138

134139
// Invoked when interface has been opened
24 Bytes
Binary file not shown.
24 Bytes
Binary file not shown.
24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)