Skip to content

[1.6.6 Pluggable HID] Compiling issues for custom HID libraries #3649

Closed
@NicoHood

Description

@NicoHood

This PR added Pluggable HID with IDE 1.6.6
#3304

I started developing some custom HID devices.
See this commit as reference: https://github.com/NicoHood/HID/tree/4df1f30427730c43216336b94673f66b546fc6d4/src

It turns out that because of static linkage all files are compiled. This means Mouse, Gamepad, System and Consumer files are all compiled and linked. Now try to open the Mouse example. It wont work because the singletons (Consumer, Gampad, System instances) add their descriptor in the constructor. I dont know why this still happens, even if you do not include the other files they will cause trouble.

First I did not notice this, because not all HID devices cause problems when used together. The mouse button was working but the moving did not. The problem is a mix of incompatible USB devices, cause by accidentialy compiled files.

So I am not sure if this is expected to be this way, but this feature request could possibly help us:
#2800

The solution for now is to delete the other .h/cpp files (if you want to try it yourself with the commit above). The long time solution would be to create 4 different libraries. This is bad for the boards manager. It'd be better if you can add a whole HID package instead of 4 (and later even more).

@facchinm

Metadata

Metadata

Assignees

Labels

Component: CoreRelated to the code for the standard Arduino API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions