Added some delays between USB commands

This commit is contained in:
Kristian Lauszus 2013-12-06 23:24:25 +01:00
parent 4f738d3ef9
commit 655b60ea90

11
adk.cpp
View file

@ -228,14 +228,23 @@ uint8_t ADK::Init(uint8_t parent, uint8_t port, bool lowspeed) {
USBTRACE2("\r\nADK protocol rev. ", adkproto); USBTRACE2("\r\nADK protocol rev. ", adkproto);
} }
delay(100);
//sending ID strings //sending ID strings
sendStr(ACCESSORY_STRING_MANUFACTURER, manufacturer); sendStr(ACCESSORY_STRING_MANUFACTURER, manufacturer);
delay(10);
sendStr(ACCESSORY_STRING_MODEL, model); sendStr(ACCESSORY_STRING_MODEL, model);
delay(10);
sendStr(ACCESSORY_STRING_DESCRIPTION, description); sendStr(ACCESSORY_STRING_DESCRIPTION, description);
delay(10);
sendStr(ACCESSORY_STRING_VERSION, version); sendStr(ACCESSORY_STRING_VERSION, version);
delay(10);
sendStr(ACCESSORY_STRING_URI, uri); sendStr(ACCESSORY_STRING_URI, uri);
delay(10);
sendStr(ACCESSORY_STRING_SERIAL, serial); sendStr(ACCESSORY_STRING_SERIAL, serial);
delay(100);
//switch to accessory mode //switch to accessory mode
//the Android phone will reset //the Android phone will reset
rcode = switchAcc(); rcode = switchAcc();
@ -243,7 +252,7 @@ uint8_t ADK::Init(uint8_t parent, uint8_t port, bool lowspeed) {
goto FailSwAcc; //init fails goto FailSwAcc; //init fails
} }
rcode = USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET; rcode = USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET;
delay(1000); // Give Android a chance to do its reset. This is a guess, and possibly could be lower. delay(100); // Give Android a chance to do its reset. This is a guess, and possibly could be lower.
goto SwAttempt; //switch to accessory mode attempted goto SwAttempt; //switch to accessory mode attempted
/* diagnostic messages */ /* diagnostic messages */