adafruit / adafruit/Adafruit_TinyUSB_Arduino

Customizable CFG_TUD_HID_EP_BUFSIZE + CFG_TUD_ENDPOINT0_SIZE

Open
#571 1 comment 0 reactions 0 assignees View on GitHub
Feature
Dominant language
C
Stars
654
Forks
183
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
For a project I'm working on, I need to be able to have full HID parity with an existing device. For this, I need the ability to change `CFG_TUD_HID_EP_BUFSIZE` from `64` to `32`. If I don't have any easy way to change the `CFG_TUD_HID_EP_BUFSIZE` define, I'd have to require builders to go in and manually edit `src/arduino/ports/*/tusb_config.h` to redefine `CFG_TUD_HID_EP_BUFSIZE` to `32`.

**Describe the solution you'd like**
Add guards/ifdef checks for `CFG_TUD_HID_EP_BUFSIZE` (and preferably `CFG_TUD_ENDPOINT0_SIZE` as well), so these values can easily be changed. With these changes, there also needs to be a static check for `CFG_TUD_ENDPOINT0_SIZE >= CFG_TUD_HID_EP_BUFSIZE` afaik.

**Additional context**

Image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the `tusb_config.h` files under `src/arduino/ports/*/` and locate the current definitions of `CFG_TUD_HID_EP_BUFSIZE` and `CFG_TUD_ENDPOINT0_SIZE`. Add configurable guards for both values and a static check enforcing `CFG_TUD_ENDPOINT0_SIZE >= CFG_TUD_HID_EP_BUFSIZE`; done means projects can override the values without manually editing the defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
57/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.