1
0
Fork 0
forked from len0rd/rockbox

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:
William Wilgus 2021-10-31 11:59:53 -04:00
parent 0b1c05db40
commit 894a9d9063
3 changed files with 24 additions and 3 deletions

View file

@ -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: */