Hello Alejandro,
sorry for answering late, but I lost focus on that topic (I didn't expect an answer anymore :smileyhappy:).
I've written a patch which propagates all ehci-Interrupts to a high priority task using a lwmessage. The high priority task handles the interrupt then, allowing doing debounce with _time_delay().
I use the follwing scheme:
in _usb_ehci_init: initialize message queue, start additional isr task
in _usb_ehci_isr: disable ehci interrupt, send usb handle via message queue
in interrupt task: while(1) {wait for message, call _usb_ehci_isrfunc (which loops until all pending interrupts are serviced), enable ehci interrupt}
in _usb_ehci_reset_and_enable_port I changed the debounce loops to loops using _time_delay()
I don't want to publish my patch here in the forum, because it is a quick and dirty solution and not tested concerning stability and side effects.