aboutsummaryrefslogtreecommitdiff
path: root/lib/usb
diff options
context:
space:
mode:
authorGareth McMullin2011-11-12 21:44:37 +1300
committerGareth McMullin2011-11-12 21:44:37 +1300
commit30e188cf07da22d9cfebdc0209bc79f1e4c34da6 (patch)
tree565867bed222e998a69e80dcfaefac2619ffd39c /lib/usb
parent7546ad9736af3d7fa6d5ce1caa9008aecd97f651 (diff)
Only allow one packet in TX fifos.
This fixes a problem where packets were written too quickly. The hardware disabled the endpoint after the fist packet is sent, and others just waited in the queue.
Diffstat (limited to 'lib/usb')
-rw-r--r--lib/usb/usb_f107.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c
index 8f03571..ecadded 100644
--- a/lib/usb/usb_f107.c
+++ b/lib/usb/usb_f107.c
@@ -245,7 +245,7 @@ static u16 stm32f107_ep_write_packet(u8 addr, const void *buf, u16 len)
addr &= 0x7F;
/* Return if endpoint is already enabled. */
- if(OTG_FS_DTXFSTS(addr) < (len >> 2))
+ if(OTG_FS_DIEPTSIZ(addr) & OTG_FS_DIEPSIZ0_PKTCNT)
return 0;
/* Enable endpoint for transmission */