Changed over manual loops waiting for endpoints to be ready to use the library Endpoint_WaitUntilReady() function for robustness. Fixes issues with terminated transfers on the host locking up USB devices.