mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Simplify and neaten-up usb.c a bit. USB_INSERTED and USB_EXTRACTED are always used as events to indicate cable state. USB_HOSTED is posted to indicated that a host was detected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31263 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
911a355d76
commit
47bade1437
6 changed files with 88 additions and 109 deletions
|
|
@ -46,7 +46,7 @@ void usb_insert_int(void)
|
|||
{
|
||||
usb_status = USB_INSERTED;
|
||||
#ifdef USB_STATUS_BY_EVENT
|
||||
usb_status_event(USB_POWERED);
|
||||
usb_status_event(USB_INSERTED);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ void usb_remove_int(void)
|
|||
{
|
||||
usb_status = USB_EXTRACTED;
|
||||
#ifdef USB_STATUS_BY_EVENT
|
||||
usb_status_event(USB_UNPOWERED);
|
||||
usb_status_event(USB_EXTRACTED);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ void usb_drv_usb_detect_event(void)
|
|||
int oldstatus = disable_irq_save(); /* May come via USB thread */
|
||||
|
||||
if (usb_status == USB_INSERTED)
|
||||
usb_status_event(USB_INSERTED);
|
||||
usb_status_event(USB_HOSTED);
|
||||
|
||||
restore_irq(oldstatus);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue