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
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue