Skip to content

Conversation

@earlephilhower
Copy link
Owner

Replace the specific device callbacks with weak stubs unless the application actually uses a library which needs it.

MSC_Device saves 2136b flash, 128b RAM
MIDI_Device saves 680b flash, 328b RAM
HID_Device saves 816b flash, 408b RAM

In total 3.6K flash and 850b RAM.

Apps which manually try and build their own usage of the low-level TinyUSB code need to include the appropriate <tusb-xxx.h> file.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Replace the specific device callbacks with weak stubs unless the application
actually uses a library which needs it.

MSC_Device saves 2136b flash, 128b RAM
MIDI_Device saves 680b flash, 328b RAM
HID_Device saves 816b flash, 408b RAM

In total 3.6K flash and 850b RAM.

Apps which manually try and build their own usage of the low-level
TinyUSB code need to include the appropriate <tusb-xxx.h> file.
Will speed up FatFSUSB and SingleFileDrive without causing memory
pressure for apps not using MSD.
There is what seems to be a known race condition in TinyUSB on the Pico,
see hathach/tinyusb#1764 .

Delay text output a little bit after the MSD is started to avoid.
@earlephilhower
Copy link
Owner Author

All tests seem to pass now (and Joystick is unbusted!)

HID

  • ✔️ Keyboard
  • ✔️ Joystick
  • ✔️ Mouse
  • ✔️ MouseAbsolute

MIDI

  • ✔️ MIDIUSB

MSD

  • ✔️ SingleFileDrive
  • ✔️ FatFSUSB

@earlephilhower earlephilhower merged commit f833c7c into master Dec 18, 2025
33 checks passed
@earlephilhower earlephilhower deleted the automat branch December 18, 2025 02:03
@earlephilhower earlephilhower restored the automat branch December 18, 2025 02:49
@earlephilhower earlephilhower deleted the automat branch December 18, 2025 03:05
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.

2 participants