arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.07k stars 7.01k forks source link

Library reference pages may list incompatible boards in the compatibility list #11871

Open sterretjeToo opened 1 year ago

sterretjeToo commented 1 year ago

https://www.arduino.cc/reference/en/libraries/keyboard/

Arduino Uno/Mega/Nano are included in the compatibility list even though they are not compatible with the Keyboard library.

Additional context

Additional reports

matthijskooijman commented 1 year ago

I suspect this list is autogenerated from the "architecture = avr" or so in the library.properties. I don't think libraries can explicitly state compatibility with some boars, but not others, so this should probably be fixed in the description instead (and looking at that page, the "compatibility note" even already does that, though it might be a bit more specific maybe).

per1234 commented 1 year ago

Hi @sterretjeToo.

@matthijskooijman already answered while I was writing, but I'll post anyway in case there is a little bit of additional information:

The library reference pages like https://www.arduino.cc/reference/en/libraries/keyboard/ are automatically generated for all the libraries in the Arduino Library Manager based on the information in their library.properties metadata file.

The "Compatibility" list on the reference pages is based on the architectures field of that file. The reference page generator simply adds all the official boards of each architecture in the field to the list.

As in this case, a library might require capabilities that are not provided by all boards of that architecture. There is no machine readable data that would allow the generator to understand this so boards that are incompatible with the library may be listed in the reference page.

There has been some internal discussion about how the library metadata system might be expanded to indicate board compatibility, but for now we settled on warning the reader about the situation via the "Compatibility note" on the reference page:

Compatibility Note

Note: while the library is supposed to compile correctly on these architectures, it might require specific hardware features that may be available only on some boards.

sterretjeToo commented 1 year ago

Unfortunately that note does not reveal anything to the beginner that consults the page. Please explain how somebody is to know what that specific hardware is?