Skip to content

Choose which USB and USB HID devices to include at compile-time (superseded by #2116) #2115

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

Closed
wants to merge 4 commits into from

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Sep 4, 2019

Make it easy to enable and disable which USB and USB HID devices to include at build time, using two makefile variables. Defaults are:

USB_DEVICES = "CDC,MSC,AUDIO,HID"
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"

For instance, in mpconfigboard.mk, you can define those variables:

USB_DEVICES = "CDC, MSC"    # Omit MIDI and HID
USB_HID_DEVICES="KEYBOARD"    # Use only keyboard

A couple of new HID devices have been added, but are not in the default set. The entire set is KEYBOARD,MOUSE,CONSUMER,SYS_CONTROL,GAMEPAD,DIGITIZER,XAC_COMPATIBLE_GAMEPAD,RAW

If only one HID device is chosen, then it will not have a report ID in the generated HID descriptor.

XAC_COMPATIBLE_GAMEPAD is an alternate gamepad that is compatible with the Microsoft XAC controller. RAW is a 64-bit raw HID device, usage page 0xFFAF, usage 0xAF (AF is "AdaFruit"). RAW cannot be used with other HID devices, because it cannot have a report id.

The mechanism for generating the table of usb_hid.Device entries has also been simplified. More code is generated and less is done by tricky Makefile variables.

This partially addresses some needs state in #1015 but does not allow generation of USB or USB HID descriptors at run-time, in boot.py.

Tagging @ATMakersBill and @hierophect for interest.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Sep 4, 2019

GitHub Actions is not initiating a check run on this.

@dhalbert dhalbert closed this Sep 4, 2019
@dhalbert dhalbert reopened this Sep 4, 2019
@dhalbert dhalbert closed this Sep 4, 2019
@dhalbert dhalbert changed the title Choose which USB and USB HID devices to include at compile-time Choose which USB and USB HID devices to include at compile-time (superseded by #2116) Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant