diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/philips/sa9200/button-sa9200.c | 17 | ||||
-rw-r--r-- | firmware/target/arm/pp/system-pp502x.c | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/firmware/target/arm/philips/sa9200/button-sa9200.c b/firmware/target/arm/philips/sa9200/button-sa9200.c index bef5be7522..c02d1088dc 100644 --- a/firmware/target/arm/philips/sa9200/button-sa9200.c +++ b/firmware/target/arm/philips/sa9200/button-sa9200.c | |||
@@ -29,6 +29,19 @@ | |||
29 | 29 | ||
30 | static int int_btn = BUTTON_NONE; | 30 | static int int_btn = BUTTON_NONE; |
31 | 31 | ||
32 | /* | ||
33 | * Generate a click sound from the player (not in headphones yet) | ||
34 | * TODO: integrate this with the "key click" option | ||
35 | */ | ||
36 | static void button_click(void) | ||
37 | { | ||
38 | GPIOF_ENABLE |= 0x08; | ||
39 | GPIOF_OUTPUT_VAL |= 0x08; | ||
40 | GPIOF_OUTPUT_EN |= 0x08; | ||
41 | udelay(1000); | ||
42 | GPIOF_OUTPUT_VAL &= ~0x08; | ||
43 | } | ||
44 | |||
32 | #ifndef BOOTLOADER | 45 | #ifndef BOOTLOADER |
33 | static bool hold_button_old = false; | 46 | static bool hold_button_old = false; |
34 | 47 | ||
@@ -135,6 +148,7 @@ bool button_hold(void) | |||
135 | */ | 148 | */ |
136 | int button_read_device(void) | 149 | int button_read_device(void) |
137 | { | 150 | { |
151 | static int btn_old = BUTTON_NONE; | ||
138 | int btn = int_btn; | 152 | int btn = int_btn; |
139 | bool hold = !(GPIOL_INPUT_VAL & 0x40); | 153 | bool hold = !(GPIOL_INPUT_VAL & 0x40); |
140 | 154 | ||
@@ -154,6 +168,9 @@ int button_read_device(void) | |||
154 | if (!(GPIOF_INPUT_VAL & 0x10)) btn |= BUTTON_VOL_UP; | 168 | if (!(GPIOF_INPUT_VAL & 0x10)) btn |= BUTTON_VOL_UP; |
155 | if (!(GPIOF_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; | 169 | if (!(GPIOF_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; |
156 | 170 | ||
171 | if ((btn != btn_old) && (btn != BUTTON_NONE)) button_click(); | ||
172 | btn_old = btn; | ||
173 | |||
157 | return btn; | 174 | return btn; |
158 | } | 175 | } |
159 | 176 | ||
diff --git a/firmware/target/arm/pp/system-pp502x.c b/firmware/target/arm/pp/system-pp502x.c index af2e6d7761..697b52cf51 100644 --- a/firmware/target/arm/pp/system-pp502x.c +++ b/firmware/target/arm/pp/system-pp502x.c | |||
@@ -489,6 +489,8 @@ void system_init(void) | |||
489 | DEV_RS = 0x00000000; | 489 | DEV_RS = 0x00000000; |
490 | DEV_RS2 = 0x00000000; | 490 | DEV_RS2 = 0x00000000; |
491 | #elif defined(PHILIPS_SA9200) | 491 | #elif defined(PHILIPS_SA9200) |
492 | DEV_INIT1 = 0x00000000; | ||
493 | DEV_INIT2 = 0x40004000; | ||
492 | /* reset all allowed devices */ | 494 | /* reset all allowed devices */ |
493 | DEV_RS = 0x3ffffef8; | 495 | DEV_RS = 0x3ffffef8; |
494 | DEV_RS2 = 0xffffffff; | 496 | DEV_RS2 = 0xffffffff; |