mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 08:02:34 -05:00
fix usb detection for usb stack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14621 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bc35acffd9
commit
1a8f7c51b3
1 changed files with 40 additions and 48 deletions
|
|
@ -149,14 +149,8 @@ int usb_detect(void)
|
||||||
status = usbstatus2 ? USB_INSERTED : USB_POWERED;
|
status = usbstatus2 ? USB_INSERTED : USB_POWERED;
|
||||||
#ifndef HAVE_USBSTACK
|
#ifndef HAVE_USBSTACK
|
||||||
dr_controller_stop();
|
dr_controller_stop();
|
||||||
#endif
|
#else
|
||||||
|
usb_stack_stop();
|
||||||
#ifdef HAVE_USBSTACK
|
|
||||||
/* TODO: Move this call - it shouldn't be done in this function */
|
|
||||||
if (status == USB_INSERTED)
|
|
||||||
{
|
|
||||||
usb_stack_start();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -186,10 +180,6 @@ int usb_detect(void)
|
||||||
if (!usbstatus1)
|
if (!usbstatus1)
|
||||||
{ /* We have just been disconnected */
|
{ /* We have just been disconnected */
|
||||||
status = USB_EXTRACTED;
|
status = USB_EXTRACTED;
|
||||||
#ifdef HAVE_USBSTACK
|
|
||||||
/* TODO: Move this call - it shouldn't be done in this function */
|
|
||||||
usb_stack_stop();
|
|
||||||
#endif
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,6 +200,8 @@ int usb_detect(void)
|
||||||
|
|
||||||
#ifndef HAVE_USBSTACK
|
#ifndef HAVE_USBSTACK
|
||||||
dr_controller_run();
|
dr_controller_run();
|
||||||
|
#else
|
||||||
|
usb_stack_start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Wait for 50 ticks (500ms) before deciding there is no computer
|
/* Wait for 50 ticks (500ms) before deciding there is no computer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue