summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2017-12-09 22:36:58 +0100
committerWilliam Wilgus <me.theuser@yahoo.com>2018-07-25 06:01:56 +0200
commit6a568761c88622321b29e338acdb5b52eff6ae3e (patch)
tree0fc491b8770b00d83cff7ecf35540f414a88e64a
parent1b68aea444e23471b57f506211a55564aeace40a (diff)
downloadrockbox-6a568761c88622321b29e338acdb5b52eff6ae3e.tar.gz
rockbox-6a568761c88622321b29e338acdb5b52eff6ae3e.zip
CLIPPLUS -- Remove un-needed handling for power button button button_read_device()
switching GPIOB in order to read GPIOD96) (power button) is apparently unneeded Change-Id: I1fbf13f67f938806086754cdd5e389ef6746ae5f
-rw-r--r--firmware/target/arm/as3525/sansa-clipplus/button-clip.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipplus/button-clip.c b/firmware/target/arm/as3525/sansa-clipplus/button-clip.c
index 60b8c8f7a3..09d62562ee 100644
--- a/firmware/target/arm/as3525/sansa-clipplus/button-clip.c
+++ b/firmware/target/arm/as3525/sansa-clipplus/button-clip.c
@@ -29,7 +29,7 @@ void button_init_device(void)
GPIOC_DIR = 0; /* All C pins input */
GPIOA_DIR &= ~(1<<1|1<<6|1<<7); /* Pins A1,A6,A7 input */
/* OF does not set D6 to input */
- GPIOB_DIR |= (1<<6); /* Pin B6 output */
+ GPIOB_DIR |= (1<<6); /* Pin B6 output */
GPIOB_DIR |= (1<<0); /* Pin B0 set output */
}
@@ -38,24 +38,25 @@ int button_read_device(void)
int buttons = 0;
/* Buttons do not appear to need reset */
- /* D6 needs special handling though */
-
+ /* D6 does not appear to need special handling */
+#if 0
GPIOB_PIN(0) = 1; /* set B0 */
int delay = 500;
do {
asm volatile("nop\n");
} while (delay--);
-
+#endif
if GPIOD_PIN(6) /* read D6 */
buttons |= BUTTON_POWER;
-
+#if 0
GPIOB_PIN(0) = 0; /* unset B0 */
delay = 240;
do {
asm volatile("nop\n");
} while (delay--);
+#endif
if GPIOA_PIN(1)
buttons |= BUTTON_HOME;
@@ -63,6 +64,9 @@ int button_read_device(void)
buttons |= BUTTON_VOL_DOWN;
if GPIOA_PIN(7)
buttons |= BUTTON_VOL_UP;
+
+ if GPIOC_PIN(1)
+ buttons |= BUTTON_DOWN;
if GPIOC_PIN(2)
buttons |= BUTTON_UP;
if GPIOC_PIN(3)
@@ -71,8 +75,6 @@ int button_read_device(void)
buttons |= BUTTON_SELECT;
if GPIOC_PIN(5)
buttons |= BUTTON_RIGHT;
- if GPIOC_PIN(1)
- buttons |= BUTTON_DOWN;
return buttons;
}