mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-06 13:15:25 -05:00
usb: Shorten debounce interval for USB status by event
The introduction of a debounce interval for USB
status by event (see e75a3fb), often resulted in the
FiiO M3K crashing after disconnecting from USB.
Shortening the interval to 10ms appears to fix this,
or make a crash much less likely at the very least.
Change-Id: Ibf1f02779ab1704d9b1c86d39b21648a3e2c4e9d
This commit is contained in:
parent
297af3a483
commit
3307b04eed
1 changed files with 8 additions and 3 deletions
|
|
@ -70,7 +70,12 @@
|
|||
#endif
|
||||
|
||||
/* USB detect debouncing interval (200ms taken from the usb polling code) */
|
||||
#define USB_DEBOUNCE_TIME (200*HZ/1000)
|
||||
#define USB_DEBOUNCE_POLL (200*HZ/1000)
|
||||
/* NOTE: "usb_dw_gonak_effective:failed!" *PANIC*s can be observed when
|
||||
disconnecting the FiiO M3K from USB with the debounce interval
|
||||
for USB_STATUS_BY_EVENT set to 200ms, as above (see e75a3fb).
|
||||
Adjusting the interval to 10ms reduces likelihood of a panic. */
|
||||
#define USB_DEBOUNCE_TIME (10*HZ/1000)
|
||||
|
||||
bool do_screendump_instead_of_usb = false;
|
||||
|
||||
|
|
@ -690,7 +695,7 @@ static void usb_tick(void)
|
|||
if(current_firewire_status != last_firewire_status)
|
||||
{
|
||||
last_firewire_status = current_firewire_status;
|
||||
firewire_countdown = USB_DEBOUNCE_TIME;
|
||||
firewire_countdown = USB_DEBOUNCE_POLL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -712,7 +717,7 @@ static void usb_tick(void)
|
|||
if(current_status != last_usb_status)
|
||||
{
|
||||
last_usb_status = current_status;
|
||||
usb_countdown = USB_DEBOUNCE_TIME;
|
||||
usb_countdown = USB_DEBOUNCE_POLL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue