Description
Describe the bug
In the future, when the library is compiled against the newly-released Adafruit TinyUSB 3.5.0 version, this library will fail to compile. It uses the USBH_EPSIZE_BULK_MAX
enum defined in a private include header (host/usbh_pvt.h
)
Lines 38 to 49 in 82a5c8e
Which was removed in adafruit/Adafruit_TinyUSB_Arduino@fafc824. All usages of this enum seem to have been replaced with USBH_EPSIZE_BULK_MAX
, which was newly defined in the src/host/usbh.h
header.
To Reproduce
Steps to reproduce the behavior:
- See project setup in https://community.platformio.org/t/usbh-epsize-bulk-max-not-defined-in-usb-midi-host-library/47483/3?u=maxgerhardt
Expected behavior
Library should not include and use types from a private include header, as the things defined therein can change without notice, not being part of an official API.
A version that would for Adafruit TinyUSB below and above 3.5.0 is to redefine
#define USED_MIDI_EPSIZE_BULK_MPS (TUD_OPT_HIGH_SPEED ? TUSB_EPSIZE_BULK_HS : TUSB_EPSIZE_BULK_FS)
since all these values are defined in the public API src/common/tusb_types.h
.
Screenshots
-/-
What is your setup like?
- Arduino
- Target hardware board: Adafruit Feather USB Host (Raspberry Pi RP2040)
- What is your build machine: Windows
- What build machine OS and version: Windows 10
- Version of this library: 2.2.0
- Version of build software: PlatformIO, platform-raspberrypi 55cd180ac22e612e7528ddac8d3fda63e09c666d
- How are you loading build images to the target: -/-
Additional context
Error message when using Adafruit TinyUSB 3.5.0
.pio\libdeps\adafruit_feather_usb_host\usb_midi_host\usb_midi_host.c:42:35: error: 'USBH_EPSIZE_BULK_MAX' undeclared here (not in a function); did you mean 'TUSB_EPSIZE_BULK_HS'?
42 | #define CFG_TUH_MIDI_RX_BUFSIZE USBH_EPSIZE_BULK_MAX
| ^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\adafruit_feather_usb_host\usb_midi_host\usb_midi_host.c:56:19: note: in expansion of macro 'CFG_TUH_MIDI_RX_BUFSIZE'
56 | } midih_limits = {CFG_TUH_MIDI_RX_BUFSIZE, CFG_TUH_MIDI_TX_BUFSIZE, CFG_TUH_MAX_CABLES};
| ^~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio\build\adafruit_feather_usb_host\src\main.cpp.o
*** [.pio\build\adafruit_feather_usb_host\libf67\usb_midi_host\usb_midi_host.c.o]