Skip to content

Commit a91b8a1

Browse files
committed
Partial fix for Endpoint buffers not getting fully reinitialized on
reenumeration
1 parent 74d9e51 commit a91b8a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/USBCore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ template<size_t L>
106106
void EPBuffer<L>::init(uint8_t ep)
107107
{
108108
this->ep = ep;
109+
this->reset();
110+
this->rxWaiting = false;
111+
this->txWaiting = false;
109112
}
110113

111114
template<size_t L>
@@ -333,6 +336,7 @@ class ClassCore
333336
* Allow data to come in to OUT buffers immediately, as it
334337
* will be copied out as it comes in.
335338
*/
339+
EPBuffers().buf(ep).init(ep);
336340
if (desc.dir() == 0) {
337341
EPBuffers().buf(ep).enableOutEndpoint();
338342
}

0 commit comments

Comments
 (0)