summaryrefslogtreecommitdiff
path: root/firmware/export/events.h
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-10-31 11:59:53 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-10-31 12:02:38 -0400
commit894a9d9063873dfbb4d0f535da7c335638c00fec (patch)
tree53c1d2e2460e5a361b7fd02fe58be1bd6dcc01ac /firmware/export/events.h
parent0b1c05db40505ec2541c151c5a07958d86b7c083 (diff)
downloadrockbox-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 'firmware/export/events.h')
-rw-r--r--firmware/export/events.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/export/events.h b/firmware/export/events.h
index 4591058d4f..8bdf1b55e2 100644
--- a/firmware/export/events.h
+++ b/firmware/export/events.h
@@ -52,7 +52,7 @@
52#define EVENT_CLASS_RECORDING 0x1000 52#define EVENT_CLASS_RECORDING 0x1000
53#define EVENT_CLASS_LCD 0x2000 53#define EVENT_CLASS_LCD 0x2000
54#define EVENT_CLASS_VOICE 0x4000 54#define EVENT_CLASS_VOICE 0x4000
55 55#define EVENT_CLASS_SYSTEM 0x8000 /*LAST ONE */
56/** 56/**
57 * Subscribe to an event with a simple callback. The callback will be called 57 * Subscribe to an event with a simple callback. The callback will be called
58 * synchronously everytime the event fires, passing the event id and data to 58 * synchronously everytime the event fires, passing the event id and data to
@@ -99,4 +99,14 @@ void remove_event_ex(unsigned short id, void (*handler)(unsigned short id, void
99 */ 99 */
100void send_event(unsigned short id, void *data); 100void send_event(unsigned short id, void *data);
101 101
102/** System events **/
103enum {
104 /* USB_INSERTED
105 data = &usbmode */
106 SYS_EVENT_USB_INSERTED = (EVENT_CLASS_SYSTEM|1),
107 /* USB_EXTRACTED
108 data = NULL */
109 SYS_EVENT_USB_EXTRACTED,
110};
111
102#endif 112#endif