mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[usb] Fix Windows enumeration.
Set the endpoint transfer size before enabling it. Change-Id: If3a02156f0019c9cc48159b07199dc2375387fb5
This commit is contained in:
@@ -14,6 +14,14 @@ namespace Device {
|
||||
void Endpoint0::setup() {
|
||||
// Setup the IN direction
|
||||
|
||||
// Reset the device IN endpoint 0 transfer size register
|
||||
class OTG::DIEPTSIZ0 dieptsiz0(0);
|
||||
/* Transfer size. The core interrupts the application only after it has
|
||||
* exhausted the transfer size amount of data. The transfer size is set to the
|
||||
* maximum packet size, to be interrupted at the end of each packet. */
|
||||
dieptsiz0.setXFRSIZ(k_maxPacketSize);
|
||||
OTG.DIEPTSIZ0()->set(dieptsiz0);
|
||||
|
||||
// Reset the device IN endpoint 0 control register
|
||||
class OTG::DIEPCTL0 diepctl0(0); // Reset value
|
||||
// Set the maximum packet size
|
||||
@@ -24,14 +32,6 @@ void Endpoint0::setup() {
|
||||
diepctl0.setEPENA(true);
|
||||
OTG.DIEPCTL0()->set(diepctl0);
|
||||
|
||||
// Reset the device IN endpoint 0 transfer size register
|
||||
class OTG::DIEPTSIZ0 dieptsiz0(0);
|
||||
/* Transfer size. The core interrupts the application only after it has
|
||||
* exhausted the transfer size amount of data. The transfer size is set to the
|
||||
* maximum packet size, to be interrupted at the end of each packet. */
|
||||
dieptsiz0.setXFRSIZ(k_maxPacketSize);
|
||||
OTG.DIEPTSIZ0()->set(dieptsiz0);
|
||||
|
||||
// Setup the OUT direction
|
||||
|
||||
setupOut();
|
||||
|
||||
Reference in New Issue
Block a user