Open Legion2 opened 3 years ago
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?