Send a null packet on end of USB transfer if last data packet is full.
This commit is contained in:
parent
d265b76001
commit
84fc40085e
|
@ -47,6 +47,18 @@ void gdb_if_putchar(unsigned char c, int flush)
|
||||||
}
|
}
|
||||||
while(usbd_ep_write_packet(usbdev, CDCACM_GDB_ENDPOINT,
|
while(usbd_ep_write_packet(usbdev, CDCACM_GDB_ENDPOINT,
|
||||||
buffer_in, count_in) <= 0);
|
buffer_in, count_in) <= 0);
|
||||||
|
|
||||||
|
if (flush && (count_in == CDCACM_PACKET_SIZE)) {
|
||||||
|
/* We need to send an empty packet for some hosts
|
||||||
|
* to accept this as a complete transfer. */
|
||||||
|
/* libopencm3 needs a change for us to confirm when
|
||||||
|
* that transfer is complete, so we just send a packet
|
||||||
|
* containing a null byte for now.
|
||||||
|
*/
|
||||||
|
while (usbd_ep_write_packet(usbdev, CDCACM_GDB_ENDPOINT,
|
||||||
|
"\0", 1) <= 0);
|
||||||
|
}
|
||||||
|
|
||||||
count_in = 0;
|
count_in = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue