Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 19th, 2010  |  syntax: Diff  |  size: 2.25 KB  |  views: 108  |  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/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S
  2. index 8bb2059..f468d35 100644
  3. --- a/rbutil/mkamsboot/dualboot/dualboot.S
  4. +++ b/rbutil/mkamsboot/dualboot/dualboot.S
  5. @@ -101,7 +101,7 @@ uclcopy:
  6.  /* TODO : M200V4 ? */
  7.  #if defined(SANSA_CLIP) || defined(SANSA_CLIPV2)
  8.  #define USB_PIN 6
  9. -#elif defined(SANSA_FUZE) || defined(SANSA_E200V2) || defined(SANSA_FUZEV2)
  10. +#elif defined(SANSA_FUZE) || defined(SANSA_E200V2)
  11.  #define USB_PIN 3
  12.  #endif
  13.  
  14. @@ -213,19 +213,53 @@ uclcopy:
  15.  
  16.          cmp     r1, #0
  17.          beq     boot_of
  18. -#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_FUZEV2)
  19. +#elif defined(SANSA_E200V2) || defined(SANSA_FUZE)
  20.          ldr     r0, =GPIOC
  21.          mov     r1, #0
  22.          str     r1, [r0, #0x400]
  23.          ldr     r1, [r0, #0x20]    /* read pin C3 */
  24.  
  25.          cmp     r1, #0             /* C3 = #0 means button pressed */
  26. -#ifdef SANSA_FUZEV2
  27. -        /* the logic is reversed on the fuzev2 */
  28. -        bne     boot_of
  29. -#else
  30.          beq     boot_of
  31. -#endif /* SANSA_FUZEV2 */
  32. +
  33. +#elif defined(SANSA_FUZEV2)
  34. +        ldr     r0, =GPIOC
  35. +        mov     r1, #0
  36. +        str     r1, [r0, #0x400]
  37. +        ldr     r1, [r0, #0x40]    /* read pin C4 */
  38. +
  39. +        cmp     r1, #0             /* C4 != #0 means select pressed */
  40. +        bne     boot_of
  41. +
  42. +#if 0
  43. +        ldr     r2, =GPIOB
  44. +        mov     r3, #(1<<0)
  45. +        ldr     r4, [r2, #0x400]
  46. +        orr     r4, r4, r3          @ GPIOB_DIR: pin0 out
  47. +        str     r4, [r2, #0x400]
  48. +
  49. +        str     r3, [r2, #0x4]      @ GPIOB_PIN(0) = 1
  50. +        mov     r4, #500
  51. +1:      nop
  52. +        subs    r4, r4, #1
  53. +        bne     1b
  54. +
  55. +        mov     r3, #0
  56. +        str     r3, [r2, #0x4]      @ GPIOB_PIN(0) = 0
  57. +        mov     r4, #240
  58. +1:      nop
  59. +        subs    r4, r4, #1
  60. +        bne     1b
  61. +#endif
  62. +
  63. +        ldr     r2, =0xC810000C     @ CCU_IO
  64. +        ldr     r3, [r2]
  65. +        orr     r3, r3, #(1<<12)    @ set   bit 12
  66. +@       bic     r3, r3, #(1<<12)    @ clear bit 12
  67. +        str     r3, [r2]
  68. +
  69. +        ldr     r1, [r0, #0x20]    /* read pin C3 */
  70. +        bne     boot_of            /* C3 != #0 means left pressed */
  71.  
  72.  #elif defined(SANSA_CLIPPLUS)
  73.          @ read pins
clone this paste RAW Paste Data