A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

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

authored by

Christian Soffke and committed by
Solomon Peachy
3307b04e 297af3a4

+8 -3
+8 -3
firmware/usb.c
··· 70 #endif 71 72 /* USB detect debouncing interval (200ms taken from the usb polling code) */ 73 - #define USB_DEBOUNCE_TIME (200*HZ/1000) 74 75 bool do_screendump_instead_of_usb = false; 76 ··· 690 if(current_firewire_status != last_firewire_status) 691 { 692 last_firewire_status = current_firewire_status; 693 - firewire_countdown = USB_DEBOUNCE_TIME; 694 } 695 else 696 { ··· 712 if(current_status != last_usb_status) 713 { 714 last_usb_status = current_status; 715 - usb_countdown = USB_DEBOUNCE_TIME; 716 } 717 else 718 {
··· 70 #endif 71 72 /* USB detect debouncing interval (200ms taken from the usb polling code) */ 73 + #define USB_DEBOUNCE_POLL (200*HZ/1000) 74 + /* NOTE: "usb_dw_gonak_effective:failed!" *PANIC*s can be observed when 75 + disconnecting the FiiO M3K from USB with the debounce interval 76 + for USB_STATUS_BY_EVENT set to 200ms, as above (see e75a3fb). 77 + Adjusting the interval to 10ms reduces likelihood of a panic. */ 78 + #define USB_DEBOUNCE_TIME (10*HZ/1000) 79 80 bool do_screendump_instead_of_usb = false; 81 ··· 695 if(current_firewire_status != last_firewire_status) 696 { 697 last_firewire_status = current_firewire_status; 698 + firewire_countdown = USB_DEBOUNCE_POLL; 699 } 700 else 701 { ··· 717 if(current_status != last_usb_status) 718 { 719 last_usb_status = current_status; 720 + usb_countdown = USB_DEBOUNCE_POLL; 721 } 722 else 723 {