File tree 1 file changed +21
-17
lines changed
1 file changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -319,30 +319,34 @@ class DoubleBufferedEPOutHandler : public EPHandler {
319
319
usbd.epBank0AckTransferComplete (ep);
320
320
// usbd.epBank0AckTransferFailed(ep); // XXX
321
321
322
- // Update counters and swap banks
322
+ // Update counters and swap banks for non-ZLP's
323
323
if (incoming == 0 ) {
324
324
last0 = usbd.epBank0ByteCount (ep);
325
- incoming = 1 ;
326
- usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data1));
327
- ready0 = true ;
328
- synchronized {
329
- if (ready1) {
330
- notify = true ;
331
- return ;
325
+ if (last0 != 0 ) {
326
+ incoming = 1 ;
327
+ usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data1));
328
+ synchronized {
329
+ ready0 = true ;
330
+ if (ready1) {
331
+ notify = true ;
332
+ return ;
333
+ }
334
+ notify = false ;
332
335
}
333
- notify = false ;
334
336
}
335
337
} else {
336
338
last1 = usbd.epBank0ByteCount (ep);
337
- incoming = 0 ;
338
- usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data0));
339
- synchronized {
340
- ready1 = true ;
341
- if (ready0) {
342
- notify = true ;
343
- return ;
339
+ if (last1 != 0 ) {
340
+ incoming = 0 ;
341
+ usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data0));
342
+ synchronized {
343
+ ready1 = true ;
344
+ if (ready0) {
345
+ notify = true ;
346
+ return ;
347
+ }
348
+ notify = false ;
344
349
}
345
- notify = false ;
346
350
}
347
351
}
348
352
release ();
You can’t perform that action at this time.
0 commit comments