Permalink
Browse files

added 20ms delay after reset per USB spec

  • Loading branch information...
1 parent 13535b0 commit 354a66690887717d51320d9823ef0256a67d36e2 @felis committed Apr 21, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 Usb.cpp
View
@@ -315,11 +315,14 @@ void USB::Task( void ) //USB state machine
tmpdata = regRd( rMODE ) | bmSOFKAENAB; //start SOF generation
regWr( rMODE, tmpdata );
usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_SOF;
+ delay = millis() + 20 //20ms wait after reset per USB spec
}
break;
case USB_ATTACHED_SUBSTATE_WAIT_SOF:
if( regRd( rHIRQ ) & bmFRAMEIRQ ) { //when first SOF received we can continue
+ if( delay < millis ) { //20ms passed
usb_task_state = USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE;
+ }
}
break;
case USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE:

0 comments on commit 354a666

Please sign in to comment.