File tree 1 file changed +9
-16
lines changed
1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -336,43 +336,36 @@ class DoubleBufferedEPOutHandler : public EPHandler {
336
336
// W : last0/1, notify
337
337
if (usbd.epBank0IsTransferComplete (ep))
338
338
{
339
- // Ack Transfer complete
340
- usbd.epBank0AckTransferComplete (ep);
341
- // usbd.epBank0AckTransferFailed(ep); // XXX
342
339
uint32_t received = usbd.epBank0ByteCount (ep);
343
340
if (received == 0 ) {
344
341
release ();
345
- return ;
346
- }
347
-
342
+ } else if (incoming == 0 ) {
348
343
// Update counters and swap banks for non-ZLP's
349
- if (incoming == 0 ) {
350
344
last0 = received;
351
345
incoming = 1 ;
352
346
usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data1));
353
347
synchronized {
354
348
ready0 = true ;
355
- if (ready1) {
356
- notify = true ;
357
- return ;
349
+ notify = ready1;
350
+ if (! notify) {
351
+ release () ;
358
352
}
359
- notify = false ;
360
353
}
361
354
} else {
362
355
last1 = received;
363
356
incoming = 0 ;
364
357
usbd.epBank0SetAddress (ep, const_cast <uint8_t *>(data0));
365
358
synchronized {
366
359
ready1 = true ;
367
- if (ready0) {
368
- notify = true ;
369
- return ;
360
+ notify = ready0;
361
+ if (! notify) {
362
+ release () ;
370
363
}
371
- notify = false ;
372
364
}
373
365
}
374
- release ();
375
366
}
367
+
368
+ usbd.epAckPendingInterrupts (ep);
376
369
}
377
370
378
371
// Returns how many bytes are stored in the buffers
You can’t perform that action at this time.
0 commit comments