aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f1
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2011-10-30 22:54:49 -0700
committerPiotr Esden-Tempski2011-10-31 14:14:05 -0700
commit990109ef4701f863da086571765a8fa00670b99c (patch)
treeb0ce4caeacc192e3246d065ab7b2ed8ce7c1f514 /examples/stm32/f1
parent4c26739ea2fca534181af785a9d5b0ad8624a4d7 (diff)
Fixed an application side buffer issue where resending the data failed. Now the example will retry to send the mirror data untill it succeeds.
Also decreased the buffer back to 64 as it needs to be changed in more then one place.
Diffstat (limited to 'examples/stm32/f1')
-rw-r--r--examples/stm32/f1/lisa-m/usb_cdcacm/cdcacm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/stm32/f1/lisa-m/usb_cdcacm/cdcacm.c b/examples/stm32/f1/lisa-m/usb_cdcacm/cdcacm.c
index 7482328..7108263 100644
--- a/examples/stm32/f1/lisa-m/usb_cdcacm/cdcacm.c
+++ b/examples/stm32/f1/lisa-m/usb_cdcacm/cdcacm.c
@@ -200,10 +200,10 @@ static void cdcacm_data_rx_cb(u8 ep)
{
(void)ep;
- char buf[128];
- int len = usbd_ep_read_packet(0x01, buf, 128);
+ char buf[64];
+ int len = usbd_ep_read_packet(0x01, buf, 64);
if(len) {
- usbd_ep_write_packet(0x82, buf, len);
+ while(usbd_ep_write_packet(0x82, buf, len) == 0);
buf[len] = 0;
}