Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 14th, 2010  |  syntax: Diff  |  size: 2.41 KB  |  views: 88  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h
  2. index 8a0a040..0d53774 100644
  3. --- a/firmware/export/config/sansaclipplus.h
  4. +++ b/firmware/export/config/sansaclipplus.h
  5. @@ -179,8 +179,8 @@
  6.  
  7.  /* enable these for the experimental usb stack */
  8.  #define HAVE_USBSTACK
  9. -#define USB_HANDLED_BY_OF
  10. -//#define USE_ROCKBOX_USB
  11. +//#define USB_HANDLED_BY_OF
  12. +#define USE_ROCKBOX_USB
  13.  #define USB_VENDOR_ID 0x0781
  14.  #define USB_PRODUCT_ID 0x74d1
  15.  
  16. diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  17. index 63f6e83..8e090fa 100644
  18. --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
  19. +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  20. @@ -31,7 +31,7 @@
  21.  #include "panic.h"
  22.  #include "mmu-arm.h"
  23.  #include "system.h"
  24. -//#define LOGF_ENABLE
  25. +#define LOGF_ENABLE
  26.  #include "logf.h"
  27.  #include "usb-drv-as3525v2.h"
  28.  #include "usb_core.h"
  29. @@ -90,6 +90,8 @@ static struct usb_endpoint endpoints[USB_NUM_ENDPOINTS][2];
  30.  static struct usb_ctrlrequest _ep0_setup_pkt __attribute__((aligned(32)));
  31.  static struct usb_ctrlrequest *ep0_setup_pkt = AS3525_UNCACHED_ADDR(&_ep0_setup_pkt);
  32.  
  33. +static int g_usbreset_count = 0;
  34. +
  35.  /* state of EP0 */
  36.  static enum ep0state ep0_state;
  37.  
  38. @@ -449,6 +451,8 @@ void usb_drv_init(void)
  39.          wakeup_init(&endpoints[ep][DIR_OUT].complete);
  40.      /* Enable global interrupts */
  41.      enable_global_interrupts();
  42. +
  43. +    g_usbreset_count = 0;
  44.  }
  45.  
  46.  void usb_drv_exit(void)
  47. @@ -587,6 +591,19 @@ void INT_USB(void)
  48.      {
  49.          logf("usb-drv: bus reset");
  50.  
  51. +        g_usbreset_count++;
  52. +
  53. +        if(g_usbreset_count == 2)
  54. +        {
  55. +            logf("usb-drv: hard reset");
  56. +            logf("--------");
  57. +            logf("--------");
  58. +            DCTL |= DCTL_sftdiscon;
  59. +            usb_delay();
  60. +            usb_drv_exit();
  61. +            usb_drv_init(); /* reset g_usbreset_count here */
  62. +        }
  63. +
  64.          /* Clear the Remote Wakeup Signalling */
  65.          DCTL &= ~DCTL_rmtwkupsig;
  66.  
  67. diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
  68. index fa723c0..b8cb035 100644
  69. --- a/firmware/usbstack/usb_storage.c
  70. +++ b/firmware/usbstack/usb_storage.c
  71. @@ -23,7 +23,7 @@
  72.  #include "usb_core.h"
  73.  #include "usb_drv.h"
  74.  #include "usb_class_driver.h"
  75. -/*#define LOGF_ENABLE*/
  76. +#define LOGF_ENABLE
  77.  #include "logf.h"
  78.  #include "storage.h"
  79.  #include "disk.h"
clone this paste RAW Paste Data