This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 19th, 2010  |  syntax: Diff  |  size: 2.34 KB  |  views: 111  |  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..2f94bc2 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,55 @@ 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. +        ldr     r2, =0xC810000C     @ CCU_IO
  43. +        ldr     r3, [r2]
  44. +        bic     r3, r3, #(1<<12)    @ clear bit 12
  45. +        str     r3, [r2]
  46. +
  47. +        ldr     r2, =GPIOB
  48. +        mov     r3, #(1<<0)
  49. +        ldr     r4, [r2, #0x400]
  50. +        orr     r4, r4, r3          @ GPIOB_DIR: pin0 out
  51. +        str     r4, [r2, #0x400]
  52. +
  53. +        str     r3, [r2, #0x4]      @ GPIOB_PIN(0) = 1
  54. +        mov     r4, #500
  55. +1:      nop
  56. +        subs    r4, r4, #1
  57. +        bne     1b
  58. +
  59. +        ldr     r4, =GPIOD
  60. +        ldr     r3, [r4, #0x400]
  61. +        bic     r3, r3, #(1<<6)
  62. +        ldr     r3, [r4, #0x100] @ read d6 and discard it
  63. +
  64. +        mov     r3, #0
  65. +        str     r3, [r2, #0x4]      @ GPIOB_PIN(0) = 0
  66. +        mov     r4, #240
  67. +1:      nop
  68. +        subs    r4, r4, #1
  69. +        bne     1b
  70. +
  71. +        ldr     r1, [r0, #0x20]    /* read pin C3 */
  72. +        bne     boot_of            /* C3 != #0 means left pressed */
  73.  
  74.  #elif defined(SANSA_CLIPPLUS)
  75.          @ read pins
clone this paste RAW Paste Data