mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
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
This commit is contained in:
parent
1b68aea444
commit
6a568761c8
1 changed files with 9 additions and 7 deletions
|
|
@ -38,24 +38,25 @@ int button_read_device(void)
|
||||||
int buttons = 0;
|
int buttons = 0;
|
||||||
|
|
||||||
/* Buttons do not appear to need reset */
|
/* 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 */
|
GPIOB_PIN(0) = 1; /* set B0 */
|
||||||
|
|
||||||
int delay = 500;
|
int delay = 500;
|
||||||
do {
|
do {
|
||||||
asm volatile("nop\n");
|
asm volatile("nop\n");
|
||||||
} while (delay--);
|
} while (delay--);
|
||||||
|
#endif
|
||||||
if GPIOD_PIN(6) /* read D6 */
|
if GPIOD_PIN(6) /* read D6 */
|
||||||
buttons |= BUTTON_POWER;
|
buttons |= BUTTON_POWER;
|
||||||
|
#if 0
|
||||||
GPIOB_PIN(0) = 0; /* unset B0 */
|
GPIOB_PIN(0) = 0; /* unset B0 */
|
||||||
|
|
||||||
delay = 240;
|
delay = 240;
|
||||||
do {
|
do {
|
||||||
asm volatile("nop\n");
|
asm volatile("nop\n");
|
||||||
} while (delay--);
|
} while (delay--);
|
||||||
|
#endif
|
||||||
|
|
||||||
if GPIOA_PIN(1)
|
if GPIOA_PIN(1)
|
||||||
buttons |= BUTTON_HOME;
|
buttons |= BUTTON_HOME;
|
||||||
|
|
@ -63,6 +64,9 @@ int button_read_device(void)
|
||||||
buttons |= BUTTON_VOL_DOWN;
|
buttons |= BUTTON_VOL_DOWN;
|
||||||
if GPIOA_PIN(7)
|
if GPIOA_PIN(7)
|
||||||
buttons |= BUTTON_VOL_UP;
|
buttons |= BUTTON_VOL_UP;
|
||||||
|
|
||||||
|
if GPIOC_PIN(1)
|
||||||
|
buttons |= BUTTON_DOWN;
|
||||||
if GPIOC_PIN(2)
|
if GPIOC_PIN(2)
|
||||||
buttons |= BUTTON_UP;
|
buttons |= BUTTON_UP;
|
||||||
if GPIOC_PIN(3)
|
if GPIOC_PIN(3)
|
||||||
|
|
@ -71,8 +75,6 @@ int button_read_device(void)
|
||||||
buttons |= BUTTON_SELECT;
|
buttons |= BUTTON_SELECT;
|
||||||
if GPIOC_PIN(5)
|
if GPIOC_PIN(5)
|
||||||
buttons |= BUTTON_RIGHT;
|
buttons |= BUTTON_RIGHT;
|
||||||
if GPIOC_PIN(1)
|
|
||||||
buttons |= BUTTON_DOWN;
|
|
||||||
|
|
||||||
return buttons;
|
return buttons;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue