Below is migration information for updating existing projects based on the MyUSB library version 1.5.2 to the 1.5.3 API. It does not indicate all new additions to the library, only areas relevant to making older projects compatible with the new API.
Library Demos
- Previously, all demos contained a serial number string descriptor, filled with all zeros. A serial number string is required in Mass Storage devices, or devices which are to retain settings when moved between ports on a machine. As people were not changing the serial number value, this was causing conflicts and so the serial number descriptor has been removed from all but the Mass Storage demo, which requires it.
- The AudioOut and AudioIn demos did not previously silence their endpoints when the host has deactivated them. Projects built upon either demo should upgrade to the latest code.
- The FEATURE_ENDPOINT macro has been renamed FEATURE_ENDPOINT_HALT, and is now correctly documented.
- The MassStoreHost demo contained errors which caused it to lock up randomly on certain devices. Projects built on the MassStoreDemo code should update to the latest version.
- The Interrupt type endpoint in the CDC based demos previously had a polling interval of 0x02, which caused problems on some Linux systems. This has been changed to 0xFF, projects built on the CDC demos should upgrade to the latest code.
- The HID keyboard and mouse demos were not previously boot mode compatible. To enable boot mode support, projects built on the keyboard or mouse demos (or derivatives) should upgrade to the latest code.
- The Mass Storage demo was not previously standards compliant. Projects built on the Mass Storage demo should upgrade to the latest code.
- The USART was not being reconfigured after the host sent new encoding settings in the USBtoSerial demo. This was previously discovered and fixed, but the change was lost. Projects built on the USBtoSerial demo should update to the latest code.
Device Mode
- The endpoint non-control stream functions now have a default timeout of 50ms between packets in the stream. If this timeout is exceeded, the function returns the new ENDPOINT_RWSTREAM_ERROR_Timeout error value. The timeout value can be overridden by defining the USB_STREAM_TIMEOUT_MS in the project makefile to the desired timeout duration in ms.
- Rather than returning fixed values, the flags indicating if the device has Remote Wakeup currently enabled and/or is self-powered are now accessed and set through the new USB_RemoteWakeupEnabled and USB_CurrentlySelfPowered macros. See the DevChapter9.h documentation for more details.
- All endpoint stream functions now require an extra Callback function parameter. Existing code may be updated to either supply NO_STREAM_CALLBACK as the extra parameter, or disable stream callbacks altogether by pasing the token NO_STREAM_CALLBACKS to the compiler using the -D switch.
Host Mode
- The pipe non-control stream functions now have a default timeout of 50ms between packets in the stream. If this timeout is exceeded, the function returns the new PIPE_RWSTREAM_ERROR_Timeout error value. The timeout value can be overridden by defining the USB_STREAM_TIMEOUT_MS in the project makefile to the desired timeout duration in ms.
- CollectionPath_t has been renamed to HID_CollectionPath_t to be more in line with the other HID parser structures.
- All pipe stream functions now require an extra Callback function parameter. Existing code may be updated to either supply NO_STREAM_CALLBACK as the extra parameter, or disable stream callbacks altogether by pasing the token NO_STREAM_CALLBACKS to the compiler using the -D switch.