mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Remove obsolete USB_DETECT_BY_DRV define throughout.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30549 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0576e71725
commit
c222f38c03
3 changed files with 13 additions and 20 deletions
|
|
@ -34,7 +34,7 @@ enum {
|
||||||
USB_EXTRACTED = 0, /* Event+State */
|
USB_EXTRACTED = 0, /* Event+State */
|
||||||
USB_INSERTED, /* Event+State */
|
USB_INSERTED, /* Event+State */
|
||||||
USB_POWERED, /* Event+State - transitional indicator if no power */
|
USB_POWERED, /* Event+State - transitional indicator if no power */
|
||||||
#if defined(USB_DETECT_BY_DRV) || defined(USB_DETECT_BY_CORE)
|
#ifdef USB_DETECT_BY_CORE
|
||||||
USB_UNPOWERED, /* Event */
|
USB_UNPOWERED, /* Event */
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
|
||||||
|
|
@ -226,9 +226,7 @@ void usb_insert_int(void)
|
||||||
timeout_register(&usb_oneshot, usb_timeout_event, HZ/5, val);
|
timeout_register(&usb_oneshot, usb_timeout_event, HZ/5, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USB_DETECT_BY_DRV: Called during the bus reset interrupt when in detect mode
|
/* USB_DETECT_BY_CORE: Called when device descriptor is requested */
|
||||||
* USB_DETECT_BY_CORE: Called when device descriptor is requested
|
|
||||||
*/
|
|
||||||
void usb_drv_usb_detect_event(void)
|
void usb_drv_usb_detect_event(void)
|
||||||
{
|
{
|
||||||
/* Filter for invalid bus reset when unplugging by checking the pin state. */
|
/* Filter for invalid bus reset when unplugging by checking the pin state. */
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,6 @@
|
||||||
#define USB_FULL_INIT
|
#define USB_FULL_INIT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USB_DETECT_BY_DRV) || defined(USB_DETECT_BY_CORE)
|
|
||||||
/* These aren't treated differently here */
|
|
||||||
#define USB_DELAYED_INSERT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
bool do_screendump_instead_of_usb = false;
|
bool do_screendump_instead_of_usb = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -370,7 +365,7 @@ static void usb_thread(void) NORETURN_ATTR;
|
||||||
#endif
|
#endif
|
||||||
static void usb_thread(void)
|
static void usb_thread(void)
|
||||||
{
|
{
|
||||||
#ifdef USB_DELAYED_INSERT
|
#ifdef USB_DETECT_BY_CORE
|
||||||
bool host_detected = false;
|
bool host_detected = false;
|
||||||
#endif
|
#endif
|
||||||
int num_acks_to_expect = 0;
|
int num_acks_to_expect = 0;
|
||||||
|
|
@ -392,7 +387,7 @@ static void usb_thread(void)
|
||||||
#endif /* HAVE_USBSTACK */
|
#endif /* HAVE_USBSTACK */
|
||||||
|
|
||||||
case USB_INSERTED:
|
case USB_INSERTED:
|
||||||
#ifdef USB_DELAYED_INSERT
|
#ifdef USB_DETECT_BY_CORE
|
||||||
if(usb_state != USB_POWERED)
|
if(usb_state != USB_POWERED)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -400,7 +395,7 @@ static void usb_thread(void)
|
||||||
break; /* Drivers configured but we're still USB_POWERED */
|
break; /* Drivers configured but we're still USB_POWERED */
|
||||||
|
|
||||||
host_detected = true;
|
host_detected = true;
|
||||||
#else /* !USB_DELAYED_INSERT */
|
#else /* !USB_DETECT_BY_CORE */
|
||||||
if(usb_state != USB_EXTRACTED)
|
if(usb_state != USB_EXTRACTED)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -408,7 +403,7 @@ static void usb_thread(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
usb_state = USB_POWERED;
|
usb_state = USB_POWERED;
|
||||||
#endif /* USB_DELAYED_INSERT */
|
#endif /* USB_DETECT_BY_CORE */
|
||||||
|
|
||||||
if(usb_power_button())
|
if(usb_power_button())
|
||||||
{
|
{
|
||||||
|
|
@ -461,7 +456,7 @@ static void usb_thread(void)
|
||||||
break;
|
break;
|
||||||
/* SYS_USB_CONNECTED_ACK */
|
/* SYS_USB_CONNECTED_ACK */
|
||||||
|
|
||||||
#ifdef USB_DELAYED_INSERT
|
#ifdef USB_DETECT_BY_CORE
|
||||||
/* In this case, these events handle cable insertion. USB driver or
|
/* In this case, these events handle cable insertion. USB driver or
|
||||||
core determines USB_INSERTED. */
|
core determines USB_INSERTED. */
|
||||||
case USB_POWERED:
|
case USB_POWERED:
|
||||||
|
|
@ -481,7 +476,7 @@ static void usb_thread(void)
|
||||||
usb_enable(false);
|
usb_enable(false);
|
||||||
/* Fall-through - other legal states can be USB_INSERTED or
|
/* Fall-through - other legal states can be USB_INSERTED or
|
||||||
USB_SCREENDUMP */
|
USB_SCREENDUMP */
|
||||||
#endif /* USB_DELAYED_INSERT */
|
#endif /* USB_DETECT_BY_CORE */
|
||||||
case USB_EXTRACTED:
|
case USB_EXTRACTED:
|
||||||
if(usb_state == USB_EXTRACTED)
|
if(usb_state == USB_EXTRACTED)
|
||||||
break;
|
break;
|
||||||
|
|
@ -495,7 +490,7 @@ static void usb_thread(void)
|
||||||
|
|
||||||
/* Ok to broadcast disconnect now */
|
/* Ok to broadcast disconnect now */
|
||||||
usb_configure_drivers(USB_EXTRACTED);
|
usb_configure_drivers(USB_EXTRACTED);
|
||||||
#ifdef USB_DELAYED_INSERT
|
#ifdef USB_DETECT_BY_CORE
|
||||||
host_detected = false;
|
host_detected = false;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
@ -549,9 +544,9 @@ void usb_status_event(int current_status)
|
||||||
{
|
{
|
||||||
/* Caller isn't expected to filter for changes in status.
|
/* Caller isn't expected to filter for changes in status.
|
||||||
* current_status:
|
* current_status:
|
||||||
* USB_DETECT_BY_DRV/CORE: USB_POWERED, USB_UNPOWERED,
|
* USB_DETECT_BY_CORE: USB_POWERED, USB_UNPOWERED,
|
||||||
USB_INSERTED (driver/core)
|
USB_INSERTED (core)
|
||||||
* else: USB_INSERTED, USB_EXTRACTED
|
* else: USB_INSERTED, USB_EXTRACTED
|
||||||
*/
|
*/
|
||||||
if(usb_monitor_enabled)
|
if(usb_monitor_enabled)
|
||||||
{
|
{
|
||||||
|
|
@ -572,7 +567,7 @@ void usb_start_monitoring(void)
|
||||||
/* An event may have been missed because it was sent before monitoring
|
/* An event may have been missed because it was sent before monitoring
|
||||||
* was enabled due to the connector already having been inserted before
|
* was enabled due to the connector already having been inserted before
|
||||||
* before or during boot. */
|
* before or during boot. */
|
||||||
#ifdef USB_DELAYED_INSERT
|
#ifdef USB_DETECT_BY_CORE
|
||||||
/* Filter the status - USB_INSERTED may happen later */
|
/* Filter the status - USB_INSERTED may happen later */
|
||||||
status = (status == USB_EXTRACTED) ? USB_UNPOWERED : USB_POWERED;
|
status = (status == USB_EXTRACTED) ? USB_UNPOWERED : USB_POWERED;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue