How to "cleanly" reconfigure USB endpoints on Teensy LC?

Netzapper

Member
I'm working on a project using Teensy LC as an assistive HID device: https://github.com/aubreyrjones/orbit_rat/ . I'm using PlatformIO and Teensyduino core. Right now I'm using `USB_SERIAL_HID` mode for mouse, keyboard, and joystick reports. This works great. Serial works great for debugging.

I would like to expand the capabilities of my device by writing a host driver that provides some basic feedback to the device (mouse screen position, context-dependent mode switches, etc.). The easiest way would just be raw HID and a tiny python usermode driver that sends updates. I don't want to use the serial endpoint as this would deprive us of the debugging resource.

I see at the top of `usb_desc.h` instructions for how to hack up the file to change the endpoints for a particular device configuration. This seems straightforward enough, and I'm glad to know that the rest of the widgetry should Just Work™ when I get it configured. I should be able to just copy over the existing raw HID endpoint to the descriptor I'm using.

But is there some clean way to then check these changes into version control? I very much want a simple `pull` of my project to be buildable without hacking up the core headers (which might be referenced by other projects users are working on). I suppose one way would be defining all the macros found in `usb_desc.h` inside of my build script, but that feels pretty yucky.
 
It was designed about the assumption of editing usb_desc.h for "simple" changes like different combinations of the existing interfaces, and editing usb_desc.c and probably other files for adding new interfaces or more substantial changes.
 
It was designed about the assumption of editing usb_desc.h for "simple" changes like different combinations of the existing interfaces, and editing usb_desc.c and probably other files for adding new interfaces or more substantial changes.

I see, fair enough. Thank you!

I'm mainly just asking, like from a software engineering perspective, how people manage and distribute the edits to those files? Is everybody checking in the core libraries to version control?
 
Back
Top