mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
USB add Insertion and Extraction callback events
We have this nice event library laying around probably a few more places we could use event callbacks Change-Id: I9180fa9d78788d161f2587110644ca3e08df6f50
This commit is contained in:
parent
0b1c05db40
commit
894a9d9063
3 changed files with 24 additions and 3 deletions
|
@ -476,7 +476,9 @@ static void NORETURN_ATTR usb_thread(void)
|
|||
usb_state = USB_POWERED;
|
||||
|
||||
usb_stack_enable(true);
|
||||
|
||||
#ifndef BOOTLOADER
|
||||
send_event(SYS_EVENT_USB_INSERTED, &usb_mode);
|
||||
#endif
|
||||
/* Power (charging-only) button */
|
||||
#ifdef HAVE_USB_POWER
|
||||
new_usbmode = usb_mode;
|
||||
|
@ -547,7 +549,9 @@ static void NORETURN_ATTR usb_thread(void)
|
|||
#ifdef HAVE_USB_POWER
|
||||
new_usbmode = usb_mode;
|
||||
#endif
|
||||
|
||||
#ifndef BOOTLOADER
|
||||
send_event(SYS_EVENT_USB_EXTRACTED, NULL);
|
||||
#endif
|
||||
usb_set_host_present(false);
|
||||
break;
|
||||
/* USB_EXTRACTED: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue