Skip to content

PluggableUSB complete port #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 12, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed some unused warning in USB-Core
  • Loading branch information
cmaglie committed Sep 9, 2015
commit 45d787ddb699a9fa5258a73b76f9a422de73a0bb
4 changes: 2 additions & 2 deletions cores/arduino/USB/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class USBDeviceClass {

// private?
uint32_t armSend(uint32_t ep, const void *data, uint32_t len);
uint8_t armRecv(uint32_t ep, uint32_t len);
uint8_t armRecvCtrlOUT(uint32_t ep, uint32_t len);
uint8_t armRecv(uint32_t ep);
uint8_t armRecvCtrlOUT(uint32_t ep);

void ISRHandler();

Expand Down
14 changes: 7 additions & 7 deletions cores/arduino/USB/USBCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ uint32_t USBDeviceClass::recvControl(void *_data, uint32_t len)
usbd.epBank0ResetReady(0);

//usbd.epBank0AckSetupReceived(0);
uint32_t read = armRecvCtrlOUT(0, len);
uint32_t read = armRecvCtrlOUT(0);
if (read > len)
read = len;
//while (!usbd.epBank0AckTransferComplete(0)) {}
Expand Down Expand Up @@ -500,7 +500,7 @@ uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len)
if (available(ep) < len)
len = available(ep);

armRecv(ep, len);
armRecv(ep);

usbd.epBank0DisableTransferComplete(ep);

Expand All @@ -518,7 +518,7 @@ uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len)
return len;
}

// Recv 1 byte if ready
// Recv 1 byte if ready
uint32_t USBDeviceClass::recv(uint32_t ep)
{
uint8_t c;
Expand All @@ -529,9 +529,9 @@ uint32_t USBDeviceClass::recv(uint32_t ep)
}
}

uint8_t USBDeviceClass::armRecvCtrlOUT(uint32_t ep, uint32_t len)
uint8_t USBDeviceClass::armRecvCtrlOUT(uint32_t ep)
{
/* get endpoint configuration from setting register */
// Get endpoint configuration from setting register
usbd.epBank0SetAddress(ep, &udd_ep_out_cache_buffer[ep]);
usbd.epBank0SetMultiPacketSize(ep, 8);
usbd.epBank0SetByteCount(ep, 0);
Expand All @@ -544,7 +544,7 @@ uint8_t USBDeviceClass::armRecvCtrlOUT(uint32_t ep, uint32_t len)
return usbd.epBank0ByteCount(ep);
}

uint8_t USBDeviceClass::armRecv(uint32_t ep, uint32_t len)
uint8_t USBDeviceClass::armRecv(uint32_t ep)
{
uint16_t count = usbd.epBank0ByteCount(ep);
if (count >= 64) {
Expand All @@ -555,7 +555,7 @@ uint8_t USBDeviceClass::armRecv(uint32_t ep, uint32_t len)
return usbd.epBank0ByteCount(ep);
}

// Blocking Send of data to an endpoint
// Blocking Send of data to an endpoint
uint32_t USBDeviceClass::send(uint32_t ep, const void *data, uint32_t len)
{
uint32_t length = 0;
Expand Down