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

usb

By: a guest on Jun 29th, 2010  |  syntax: Diff  |  size: 2.09 KB  |  views: 158  |  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/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  2. index e324a16..e7dad85 100644
  3. --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
  4. +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  5. @@ -427,6 +427,36 @@ static void disable_global_interrupts(void)
  6.      VIC_INT_EN_CLEAR = INTERRUPT_USB;
  7.  }
  8.  
  9. +static void dump_regs(void)
  10. +{
  11. +    logf("DSTS: %lx", DSTS);
  12. +    logf("DOEPCTL0=%lx", DOEPCTL(0));
  13. +    logf("DOEPTSIZ=%lx", DOEPTSIZ(0));
  14. +    logf("DIEPCTL0=%lx", DIEPCTL(0));
  15. +    logf("DOEPMSK=%lx", DOEPMSK);
  16. +    logf("DIEPMSK=%lx", DIEPMSK);
  17. +    logf("DAINTMSK=%lx", DAINTMSK);
  18. +    logf("DAINT=%lx", DAINT);
  19. +    logf("GINTSTS=%lx", GINTSTS);
  20. +    logf("GINTMSK=%lx", GINTMSK);
  21. +    logf("DCTL=%lx", DCTL);
  22. +    logf("GAHBCFG=%lx", GAHBCFG);
  23. +    logf("GUSBCFG=%lx", GUSBCFG);
  24. +    logf("DCFG=%lx", DCFG);
  25. +    logf("DTHRCTL=%lx", DTHRCTL);
  26. +}
  27. +
  28. +static void usb_tick(void)
  29. +{
  30. +    static int last_tick = 0;
  31. +    if(TIME_AFTER(current_tick, last_tick + 5 * HZ))
  32. +    {
  33. +        logf("usb-drv: tick %ld", current_tick);
  34. +        dump_regs();
  35. +        last_tick = current_tick;
  36. +    }
  37. +}
  38. +
  39.  void usb_drv_init(void)
  40.  {
  41.      unsigned i, ep;
  42. @@ -444,6 +474,8 @@ void usb_drv_init(void)
  43.          wakeup_init(&endpoints[ep][DIR_OUT].complete);
  44.      /* Enable global interrupts */
  45.      enable_global_interrupts();
  46. +
  47. +    tick_add_task(&usb_tick);
  48.  }
  49.  
  50.  void usb_drv_exit(void)
  51. diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
  52. index 549e15d..41eab28 100644
  53. --- a/firmware/usbstack/usb_core.c
  54. +++ b/firmware/usbstack/usb_core.c
  55. @@ -671,7 +671,7 @@ static void request_handler_device(struct usb_ctrlrequest* req)
  56.                  unsigned char address = req->wValue;
  57.                  logf("usb_core: SET_ADR %d", address);
  58.                  usb_drv_send(EP_CONTROL, NULL, 0);
  59. -                usb_drv_cancel_all_transfers();
  60. +                //usb_drv_cancel_all_transfers();
  61.                  usb_address = address;
  62.                  usb_drv_set_address(usb_address);
  63.                  usb_state = ADDRESS;
clone this paste RAW Paste Data