Add Mix&Match option for USB#779
Open
rastersoft wants to merge 1 commit intoPaulStoffregen:masterfrom
Open
Conversation
This patch allows to freely select keyboard (with or without multimedia keys), mouse, joystick, serial port, and debug, in a mix&match way, allowing to have any combination of those USB interfaces (as long as your microcontroller has enough endpoints, of course). It uses some C PreProcessor magic to dinamically assign the endpoints, addresses and everything else, as it can be seen in usb_private.h, lines 116 onward, and usb.c, lines 288 onward. To use this mode, select "USB Mix and Match (M&M)" as the USB type, and then enable or disable the M&M options, according to your needs. Currently it's only implemented for teensy 2.0, but should be straightforward to implement for all others, and also to add all the other interfaces (disc, MIDI...).
Author
|
Where should I send the patch with the |
Author
|
Ok, this .diff contains the changes required to |
Author
|
The files were made by "mixing" the ones from "usb_serial_hid" into "usb_hid". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch allows to freely select keyboard (with or without multimedia keys), mouse, joystick, serial port, and debug, in a mix&match way, allowing to have any combination of those USB interfaces (as long as your microcontroller has enough endpoints, of course).
It uses some C PreProcessor magic to dinamically assign the endpoints, addresses and everything else, as it can be seen in usb_private.h, lines 116 onward, and usb.c, lines 288 onward.
To use this mode, select "USB Mix and Match (M&M)" as the USB type in ArduinoIDE, and then enable or disable the M&M options, according to your needs. Or define the desired elements by adding as many -DUSB_MAM_XXXXX_1 as required (with XXXXX being SERIAL, KEYBOARD, MULTIMEDIA, MOUSE, JOYSTIC or DEBUG).
Currently it's only implemented for teensy 2.0 because that's the only board I have, but should be straightforward to implement for all others, and also to add all the other interfaces (disc, MIDI...).