diff options
author | William Wilgus <me.theuser@yahoo.com> | 2017-12-09 22:36:58 +0100 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-07-25 06:01:56 +0200 |
commit | 6a568761c88622321b29e338acdb5b52eff6ae3e (patch) | |
tree | 0fc491b8770b00d83cff7ecf35540f414a88e64a | |
parent | 1b68aea444e23471b57f506211a55564aeace40a (diff) | |
download | rockbox-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.c | 16 |
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) | |||
29 | GPIOC_DIR = 0; /* All C pins input */ | 29 | GPIOC_DIR = 0; /* All C pins input */ |
30 | GPIOA_DIR &= ~(1<<1|1<<6|1<<7); /* Pins A1,A6,A7 input */ | 30 | GPIOA_DIR &= ~(1<<1|1<<6|1<<7); /* Pins A1,A6,A7 input */ |
31 | /* OF does not set D6 to input */ | 31 | /* OF does not set D6 to input */ |
32 | GPIOB_DIR |= (1<<6); /* Pin B6 output */ | 32 | GPIOB_DIR |= (1<<6); /* Pin B6 output */ |
33 | GPIOB_DIR |= (1<<0); /* Pin B0 set output */ | 33 | GPIOB_DIR |= (1<<0); /* Pin B0 set output */ |
34 | } | 34 | } |
35 | 35 | ||
@@ -38,24 +38,25 @@ int button_read_device(void) | |||
38 | int buttons = 0; | 38 | int buttons = 0; |
39 | 39 | ||
40 | /* Buttons do not appear to need reset */ | 40 | /* Buttons do not appear to need reset */ |
41 | /* D6 needs special handling though */ | 41 | /* D6 does not appear to need special handling */ |
42 | 42 | #if 0 | |
43 | GPIOB_PIN(0) = 1; /* set B0 */ | 43 | GPIOB_PIN(0) = 1; /* set B0 */ |
44 | 44 | ||
45 | int delay = 500; | 45 | int delay = 500; |
46 | do { | 46 | do { |
47 | asm volatile("nop\n"); | 47 | asm volatile("nop\n"); |
48 | } while (delay--); | 48 | } while (delay--); |
49 | 49 | #endif | |
50 | if GPIOD_PIN(6) /* read D6 */ | 50 | if GPIOD_PIN(6) /* read D6 */ |
51 | buttons |= BUTTON_POWER; | 51 | buttons |= BUTTON_POWER; |
52 | 52 | #if 0 | |
53 | GPIOB_PIN(0) = 0; /* unset B0 */ | 53 | GPIOB_PIN(0) = 0; /* unset B0 */ |
54 | 54 | ||
55 | delay = 240; | 55 | delay = 240; |
56 | do { | 56 | do { |
57 | asm volatile("nop\n"); | 57 | asm volatile("nop\n"); |
58 | } while (delay--); | 58 | } while (delay--); |
59 | #endif | ||
59 | 60 | ||
60 | if GPIOA_PIN(1) | 61 | if GPIOA_PIN(1) |
61 | buttons |= BUTTON_HOME; | 62 | buttons |= BUTTON_HOME; |
@@ -63,6 +64,9 @@ int button_read_device(void) | |||
63 | buttons |= BUTTON_VOL_DOWN; | 64 | buttons |= BUTTON_VOL_DOWN; |
64 | if GPIOA_PIN(7) | 65 | if GPIOA_PIN(7) |
65 | buttons |= BUTTON_VOL_UP; | 66 | buttons |= BUTTON_VOL_UP; |
67 | |||
68 | if GPIOC_PIN(1) | ||
69 | buttons |= BUTTON_DOWN; | ||
66 | if GPIOC_PIN(2) | 70 | if GPIOC_PIN(2) |
67 | buttons |= BUTTON_UP; | 71 | buttons |= BUTTON_UP; |
68 | if GPIOC_PIN(3) | 72 | if GPIOC_PIN(3) |
@@ -71,8 +75,6 @@ int button_read_device(void) | |||
71 | buttons |= BUTTON_SELECT; | 75 | buttons |= BUTTON_SELECT; |
72 | if GPIOC_PIN(5) | 76 | if GPIOC_PIN(5) |
73 | buttons |= BUTTON_RIGHT; | 77 | buttons |= BUTTON_RIGHT; |
74 | if GPIOC_PIN(1) | ||
75 | buttons |= BUTTON_DOWN; | ||
76 | 78 | ||
77 | return buttons; | 79 | return buttons; |
78 | } | 80 | } |