diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-10-31 11:59:53 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2021-10-31 12:02:38 -0400 |
commit | 894a9d9063873dfbb4d0f535da7c335638c00fec (patch) | |
tree | 53c1d2e2460e5a361b7fd02fe58be1bd6dcc01ac /uisimulator/common/sim_tasks.c | |
parent | 0b1c05db40505ec2541c151c5a07958d86b7c083 (diff) | |
download | rockbox-894a9d9063873dfbb4d0f535da7c335638c00fec.tar.gz rockbox-894a9d9063873dfbb4d0f535da7c335638c00fec.zip |
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
Diffstat (limited to 'uisimulator/common/sim_tasks.c')
-rw-r--r-- | uisimulator/common/sim_tasks.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/uisimulator/common/sim_tasks.c b/uisimulator/common/sim_tasks.c index c862d4d909..809b50569f 100644 --- a/uisimulator/common/sim_tasks.c +++ b/uisimulator/common/sim_tasks.c | |||
@@ -145,10 +145,17 @@ void sim_trigger_screendump(void) | |||
145 | static bool is_usb_inserted; | 145 | static bool is_usb_inserted; |
146 | void sim_trigger_usb(bool inserted) | 146 | void sim_trigger_usb(bool inserted) |
147 | { | 147 | { |
148 | int usbmode = 0; | ||
148 | if (inserted) | 149 | if (inserted) |
150 | { | ||
151 | send_event(SYS_EVENT_USB_INSERTED, &usbmode); | ||
149 | queue_post(&sim_queue, SIM_USB_INSERTED, 0); | 152 | queue_post(&sim_queue, SIM_USB_INSERTED, 0); |
153 | } | ||
150 | else | 154 | else |
155 | { | ||
156 | send_event(SYS_EVENT_USB_EXTRACTED, NULL); | ||
151 | queue_post(&sim_queue, SIM_USB_EXTRACTED, 0); | 157 | queue_post(&sim_queue, SIM_USB_EXTRACTED, 0); |
158 | } | ||
152 | is_usb_inserted = inserted; | 159 | is_usb_inserted = inserted; |
153 | } | 160 | } |
154 | 161 | ||