summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c')
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
index 71d45c385c..25a69d7630 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
@@ -17,7 +17,6 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <stdlib.h>
21#include "config.h" 20#include "config.h"
22#include "cpu.h" 21#include "cpu.h"
23#include "system.h" 22#include "system.h"
@@ -44,24 +43,16 @@ static int const remote_buttons[] =
44 BUTTON_NONE, /* Nothing in the headphone socket */ 43 BUTTON_NONE, /* Nothing in the headphone socket */
45}; 44};
46 45
47
48
49
50
51void button_init_device(void) 46void button_init_device(void)
52{ 47{
53 /* Power, Remote Play & Hold switch */ 48 /* Power, Remote Play & Hold switch */
54} 49}
55 50
56
57
58inline bool button_hold(void) 51inline bool button_hold(void)
59{ 52{
60 return (GPGDAT & (1 << 15)); 53 return (GPGDAT & (1 << 15));
61} 54}
62 55
63
64
65int button_read_device(void) 56int button_read_device(void)
66{ 57{
67 int touchpad; 58 int touchpad;
@@ -91,6 +82,7 @@ int button_read_device(void)
91 /* if the buttons dont agree twice in a row, then its none */ 82 /* if the buttons dont agree twice in a row, then its none */
92 lastbutton = btn; 83 lastbutton = btn;
93 btn = BUTTON_NONE; 84 btn = BUTTON_NONE;
85 button_backlight_on();
94 } 86 }
95 87
96 /* Check for hold first - exit if asserted with no button pressed */ 88 /* Check for hold first - exit if asserted with no button pressed */
@@ -115,6 +107,7 @@ int button_read_device(void)
115 107
116 if (buttons & (1 << 4)) 108 if (buttons & (1 << 4))
117 btn |= BUTTON_A; 109 btn |= BUTTON_A;
110 button_backlight_on();
118 } 111 }
119 112
120 /* the touchpad */ 113 /* the touchpad */
@@ -135,13 +128,12 @@ int button_read_device(void)
135 128
136 if (touchpad & (1 << 3)) 129 if (touchpad & (1 << 3))
137 btn |= BUTTON_SELECT; 130 btn |= BUTTON_SELECT;
131 button_backlight_on();
138 } 132 }
139 133
140 return btn; 134 return btn;
141} 135}
142 136
143
144
145bool headphones_inserted(void) 137bool headphones_inserted(void)
146{ 138{
147 unsigned short remote_adc = adc_read(ADC_HPREMOTE); 139 unsigned short remote_adc = adc_read(ADC_HPREMOTE);