Re: Wake USB Host micro when thumb drive connected
Thanks for the advice ric!
I've tried the first stages of this method. I'm using the Interrupt-on-Change mechanisms on the D+ and/or D- ports. If during my 1Hz wakeup, a rising edge has been detected on D+ and/or D-, the micro stays awake, and runs the USBTasks(). This gets everything working quickly, and it seems to all be correct.
I now just need to add some debounce control and extraction detection.
(I had noted this comment against USBHostTasks() : "This routine should be called on a regular basis, but there is no specific time requirement. Devices will still be able to attach, enumerate, and detach, but the operations will occur more slowly as the calling interval increases." Since I had only been calling it once per waking cycle, I saw that it was going to take ages to make an attachment.)