-
Notifications
You must be signed in to change notification settings - Fork 91
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
Is there an easy way to have MIDI only, without serial? #50
Comments
Hi @amowry , |
Okay, thanks—I did end up finding a way to remove the CDC by modifying the core files (I’m using a standalone 32u4). Assuming CDC is removed, should the library create a class-compliant device? |
This patch should be enough to get rid of CDC on 32u4 and obtain a compliant MIDIUSB device --- a/cores/arduino/USBCore.cpp
+++ b/cores/arduino/USBCore.cpp
@@ -331,10 +333,6 @@ int USB_Send(uint8_t ep, const void* d, int len)
uint16_t _initEndpoints[USB_ENDPOINTS] =
{
0, // Control Endpoint
-
- EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
- EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
- EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
// Following endpoints are automatically initialized to 0
};
@@ -382,9 +380,6 @@ bool ClassInterfaceRequest(USBSetup& setup)
{
uint8_t i = setup.wIndex;
- if (CDC_ACM_INTERFACE == i)
- return CDC_Setup(setup);
-
#ifdef PLUGGABLE_USB_ENABLED
return PluggableUSB().setup(setup);
#endif
@@ -473,8 +468,6 @@ static uint8_t SendInterfaces()
{
uint8_t interfaces = 0;
- CDC_GetInterface(&interfaces);
-
#ifdef PLUGGABLE_USB_ENABLED
PluggableUSB().getInterface(&interfaces);
#endif
@@ -862,8 +855,8 @@ bool USBDevice_::wakeupHost()
return false;
}
-PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT),
- lastEp(CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT),
+PluggableUSB_::PluggableUSB_() : lastIf(0),
+ lastEp(0),
rootNode(NULL), totalEP(USB_ENDPOINTS)
{
// Empty The resulting descriptor is
|
Thank you! Is this for an earlier version of USBCore.cpp? I don't see these lines: `-PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT),
However, I made the other changes and it seems to have removed CDC. I'm not sure how to tell for sure if it did it correctly ;) For anyone who is interested, the file can be put in the sketch folder, so it will only affect the given sketch. |
This library is great! I was wondering if there's a way to to turn off serial in order to make fully class-compliant devices, similar to the way Teensy works? Thanks!
The text was updated successfully, but these errors were encountered: