Index: /root/rockbox/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c =================================================================== --- /root/rockbox/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c (revision 19034) +++ /root/rockbox/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c (working copy) @@ -70,7 +70,7 @@ /* device buttons */ void button_int(void) { - unsigned char state; + /* unsigned char state; */ int_btn = BUTTON_NONE; @@ -84,6 +84,42 @@ #ifdef BOOTLOADER /* Read buttons directly in the bootloader */ button_int(); + + int_btn = BUTTON_NONE; + + GPIOB_DIR = 0; + GPIOC_DIR = 0; + GPIOB_AFSEL = 0; + GPIOC_AFSEL = 0; + + GPIOC_PIN(0) |= 1; + GPIOC_PIN(1) |= 1; + GPIOC_PIN(2) |= 1; + GPIOC_PIN(3) |= 1; + GPIOC_PIN(4) |= 1; + GPIOC_PIN(5) |= 1; + GPIOC_PIN(6) |= 1; + GPIOC_PIN(7) |= 1; + + /* direct GPIO connections */ + if (GPIOB_PIN(4)) + int_btn |= BUTTON_POWER; + if (!GPIOC_PIN(6)) + int_btn |= BUTTON_DOWN; + if (!GPIOC_PIN(5)) + int_btn |= BUTTON_RIGHT; + if (!GPIOC_PIN(4)) + int_btn |= BUTTON_SELECT; + if (!GPIOC_PIN(3)) + int_btn |= BUTTON_LEFT; + if (!GPIOC_PIN(2)) + int_btn |= BUTTON_UP; + + GPIOB_AFSEL = 0xfc; /* return to settings needed for lcd */ + GPIOC_AFSEL = 0xff; /* return to settings needed for lcd */ + + return int_btn; + #else /* light handling */ if (hold_button != hold_button_old)