From 727cb798e17287c61c8253d190df6008b590eb01 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Mon, 18 May 2026 18:42:58 +0200 Subject: [PATCH] usb: disable status event debouncing commit 3307b04 didn't fully get rid of the PANICs observed on the Fiio M3K after adding a debounce interval for USB status by event in e75a3fb, so this reverts to the previous behavior Change-Id: I42b45a545eb1e26fa3ae3150504712079678f96e --- firmware/usb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/firmware/usb.c b/firmware/usb.c index 406a635140..bcc8bca9ed 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -565,6 +565,7 @@ void usb_charger_update(void) #endif #ifdef USB_STATUS_BY_EVENT +#if 0 /* usb_dw_gonak_effective: failed! PANIC */ static int usb_status_tmo_callback(struct timeout* tmo) { if(usb_monitor_enabled) @@ -586,11 +587,14 @@ static int usb_status_tmo_callback(struct timeout* tmo) return 0; } +#endif void usb_status_event(int current_status) { +#if 0 /* usb_dw_gonak_effective: failed! PANIC */ static struct timeout tmo; static int last_status = USB_EXTRACTED; +#endif /* Caller isn't expected to filter for changes in status. * current_status: @@ -599,9 +603,14 @@ void usb_status_event(int current_status) if(usb_monitor_enabled) { int oldstatus = disable_irq_save(); /* Dual-use function */ +#if 0 /* usb_dw_gonak_effective: failed! PANIC */ last_status = current_status; timeout_register(&tmo, usb_status_tmo_callback, USB_DEBOUNCE_TIME, (intptr_t)&last_status); +#else + queue_remove_from_head(&usb_queue, current_status); + queue_post(&usb_queue, current_status, 0); +#endif restore_irq(oldstatus); } }