diff options
Diffstat (limited to 'firmware/target/arm/olympus')
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/button-mr100.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/firmware/target/arm/olympus/mrobe-100/button-mr100.c b/firmware/target/arm/olympus/mrobe-100/button-mr100.c index 9cfd8affa9..130c32739a 100644 --- a/firmware/target/arm/olympus/mrobe-100/button-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/button-mr100.c | |||
@@ -35,8 +35,6 @@ | |||
35 | static int int_btn = BUTTON_NONE; | 35 | static int int_btn = BUTTON_NONE; |
36 | 36 | ||
37 | #ifndef BOOTLOADER | 37 | #ifndef BOOTLOADER |
38 | static int syn_status = 0; | ||
39 | |||
40 | void button_init_device(void) | 38 | void button_init_device(void) |
41 | { | 39 | { |
42 | /* enable touchpad leds */ | 40 | /* enable touchpad leds */ |
@@ -58,21 +56,9 @@ void button_init_device(void) | |||
58 | GPIOD_OUTPUT_EN |= 0x4; /* DATA */ | 56 | GPIOD_OUTPUT_EN |= 0x4; /* DATA */ |
59 | GPIOD_OUTPUT_VAL |= 0x4; /* high */ | 57 | GPIOD_OUTPUT_VAL |= 0x4; /* high */ |
60 | 58 | ||
61 | if (syn_init()) | 59 | if (!syn_init()) |
62 | { | 60 | { |
63 | #ifdef ROCKBOX_HAS_LOGF | 61 | logf("button_init_dev: touchpad not ready"); |
64 | syn_info(); | ||
65 | #endif | ||
66 | |||
67 | syn_status = 1; | ||
68 | |||
69 | /* enable interrupts */ | ||
70 | GPIOD_INT_LEV &= ~0x2; | ||
71 | GPIOD_INT_CLR |= 0x2; | ||
72 | GPIOD_INT_EN |= 0x2; | ||
73 | |||
74 | CPU_INT_EN |= HI_MASK; | ||
75 | CPU_HI_INT_EN |= GPIO0_MASK; | ||
76 | } | 62 | } |
77 | } | 63 | } |
78 | 64 | ||
@@ -86,13 +72,12 @@ void button_int(void) | |||
86 | 72 | ||
87 | int_btn = BUTTON_NONE; | 73 | int_btn = BUTTON_NONE; |
88 | 74 | ||
89 | if (syn_status) | 75 | if (syn_get_status()) |
90 | { | 76 | { |
91 | /* disable interrupt while we read the touchpad */ | 77 | /* disable interrupt while we read the touchpad */ |
92 | GPIOD_INT_EN &= ~0x2; | 78 | syn_int_enable(false); |
93 | GPIOD_INT_CLR |= 0x2; | ||
94 | 79 | ||
95 | val = syn_read_device(data, 4); | 80 | val = syn_read(data, 4); |
96 | if (val > 0) | 81 | if (val > 0) |
97 | { | 82 | { |
98 | val = data[0] & 0xff; /* packet header */ | 83 | val = data[0] & 0xff; /* packet header */ |
@@ -119,7 +104,7 @@ void button_int(void) | |||
119 | int_btn |= BUTTON_RIGHT; | 104 | int_btn |= BUTTON_RIGHT; |
120 | 105 | ||
121 | /* An Absolute packet should follow which we ignore */ | 106 | /* An Absolute packet should follow which we ignore */ |
122 | val = syn_read_device(data, 4); | 107 | val = syn_read(data, 4); |
123 | 108 | ||
124 | logf(" int_btn = 0x%04x", int_btn); | 109 | logf(" int_btn = 0x%04x", int_btn); |
125 | } | 110 | } |
@@ -148,8 +133,7 @@ void button_int(void) | |||
148 | } | 133 | } |
149 | 134 | ||
150 | /* re-enable interrupts */ | 135 | /* re-enable interrupts */ |
151 | GPIOD_INT_LEV &= ~0x2; | 136 | syn_int_enable(true); |
152 | GPIOD_INT_EN |= 0x2; | ||
153 | } | 137 | } |
154 | } | 138 | } |
155 | #else | 139 | #else |