-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Each core provides a different USBAPI #141
Comments
This is one of the biggest reason if not the only reason I don't like Arduino/Arduino-compatibles despite its quite mature ecosystem. PluggableUSB was pretty ambitious when it came out but in the end it's practically nothing but an internal implementation detail. |
Yes unfortunately the api for drivers such as usb are not compatible. What I have learned is that the Arduino ecosystem is only useful for one time prototypes but does not scale well enough as you need to modify the software to integrate it into different hardware. Example of this are the libraries that support multiple boards. They typically use #if #ifdef to mitigate the differences in API. |
The Arduino Core API defines a very low level USB api in api/USBAPI.h. This API is implemented by the avr core in cores/arduino/USBCore.cpp. But it is not implemented by samd core, which implements the same functionality but in its own
USBDeviceClass
class. The USB implementation in megaavr core (USBCore.cpp
) is a copy of the avr usb implementation with some deviations. The mbed core implements its own version of thePluggableUSBModule
.As a result, each core implements its own USB API which is incompatible with the others, there exist many code duplicates and users of the USB API have to understand and adapt their code to each individual core implementation.
Are there any plans to improve this situation?
The text was updated successfully, but these errors were encountered: