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 70 #endif 71 71 72 72 /* USB detect debouncing interval (200ms taken from the usb polling code) */ 73 - #define USB_DEBOUNCE_TIME (200*HZ/1000) 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) 74 79 75 80 bool do_screendump_instead_of_usb = false; 76 81 ··· 690 695 if(current_firewire_status != last_firewire_status) 691 696 { 692 697 last_firewire_status = current_firewire_status; 693 - firewire_countdown = USB_DEBOUNCE_TIME; 698 + firewire_countdown = USB_DEBOUNCE_POLL; 694 699 } 695 700 else 696 701 { ··· 712 717 if(current_status != last_usb_status) 713 718 { 714 719 last_usb_status = current_status; 715 - usb_countdown = USB_DEBOUNCE_TIME; 720 + usb_countdown = USB_DEBOUNCE_POLL; 716 721 } 717 722 else 718 723 {