More adjustments to MyUSB, for the upcomming V1.1.0 release. I’ve added in a powerless-pullup device workaround (the same method used by Atmel, since I don’t have access to such a faulty device) for non-compliant USB devices. That woraround prevents incorrect disconnection events after a USB bus reset when certain badly-engineered USB devices are attached. I still need to write a workaround for another class of badly designed devices; ones which do not signal a connection within the given 300mS and thus cause the VBUS to be disconnected prematurely before the enumeration commences.
I’ve also added in a new internal USB header file to define tokens in response to the defined USB mode in the user project makefile. As positive checks (#ifdef USB_CAN_BE_HOST) are easier to read than the negative checks currently used (#ifndef USB_DEVICE_ONLY) the new header file makes the compile-time mode separation clearer in the source.
While implementing the above workaround for the power-less pullup devices, I discovered a few mistakes I’d made: the DCONNI interrupt was enabled after a USB bus reset (which is incorrect - it is polled rather than vectored) and the DDISCI interrupt was never disabled after being enabled in the host state machine. While minor, the former especially can have a negative impact on performance in some cases and so I’ve corrected the source.
Non-compliance with the protocol layer I can understand, but how these devices that are non-compliant at the electrical layer passed QA I’ve no idea. Minus one to progress, I suppose.
Recent Comments