mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -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
|
|
@ -212,7 +212,7 @@ static int usb_status = USB_EXTRACTED;
|
|||
|
||||
static int usb_timeout_event(struct timeout *tmo)
|
||||
{
|
||||
usb_status_event(tmo->data == USB_GPIO_VAL ? USB_POWERED : USB_UNPOWERED);
|
||||
usb_status_event(tmo->data == USB_GPIO_VAL ? USB_INSERTED : USB_EXTRACTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ void usb_drv_usb_detect_event(void)
|
|||
{
|
||||
/* Filter for invalid bus reset when unplugging by checking the pin state. */
|
||||
if(usb_plugged()) {
|
||||
usb_status_event(USB_INSERTED);
|
||||
usb_status_event(USB_HOSTED);
|
||||
}
|
||||
}
|
||||
#endif /* USB_STATUS_BY_EVENT */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue