mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05: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
|
|
@ -52,7 +52,7 @@
|
|||
#define EVENT_CLASS_RECORDING 0x1000
|
||||
#define EVENT_CLASS_LCD 0x2000
|
||||
#define EVENT_CLASS_VOICE 0x4000
|
||||
|
||||
#define EVENT_CLASS_SYSTEM 0x8000 /*LAST ONE */
|
||||
/**
|
||||
* Subscribe to an event with a simple callback. The callback will be called
|
||||
* 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
|
|||
*/
|
||||
void send_event(unsigned short id, void *data);
|
||||
|
||||
/** System events **/
|
||||
enum {
|
||||
/* USB_INSERTED
|
||||
data = &usbmode */
|
||||
SYS_EVENT_USB_INSERTED = (EVENT_CLASS_SYSTEM|1),
|
||||
/* USB_EXTRACTED
|
||||
data = NULL */
|
||||
SYS_EVENT_USB_EXTRACTED,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue