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

@ -145,10 +145,17 @@ void sim_trigger_screendump(void)
static bool is_usb_inserted;
void sim_trigger_usb(bool inserted)
{
int usbmode = 0;
if (inserted)
{
send_event(SYS_EVENT_USB_INSERTED, &usbmode);
queue_post(&sim_queue, SIM_USB_INSERTED, 0);
}
else
{
send_event(SYS_EVENT_USB_EXTRACTED, NULL);
queue_post(&sim_queue, SIM_USB_EXTRACTED, 0);
}
is_usb_inserted = inserted;
}