summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c')
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
index ad0dd16ff3..1474e067c1 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
@@ -198,7 +198,8 @@ static struct button_area_t button_areas[] =
198 {0, 0, 0, 0, 0}, 198 {0, 0, 0, 0, 0},
199}; 199};
200 200
201#define RMI_INTERRUPT 1 201#define RMI_INTERRUPT 1
202#define RMI_SET_SENSITIVITY 2
202 203
203static int touchpad_btns = 0; 204static int touchpad_btns = 0;
204static long rmi_stack [DEFAULT_STACK_SIZE/sizeof(long)]; 205static long rmi_stack [DEFAULT_STACK_SIZE/sizeof(long)];
@@ -232,6 +233,11 @@ static void rmi_attn_cb(int bank, int pin, intptr_t user)
232 queue_post(&rmi_queue, RMI_INTERRUPT, 0); 233 queue_post(&rmi_queue, RMI_INTERRUPT, 0);
233} 234}
234 235
236void touchpad_set_sensitivity(int level)
237{
238 queue_post(&rmi_queue, RMI_SET_SENSITIVITY, level);
239}
240
235static void rmi_thread(void) 241static void rmi_thread(void)
236{ 242{
237 struct queue_event ev; 243 struct queue_event ev;
@@ -245,6 +251,12 @@ static void rmi_thread(void)
245 usb_acknowledge(SYS_USB_CONNECTED_ACK); 251 usb_acknowledge(SYS_USB_CONNECTED_ACK);
246 continue; 252 continue;
247 } 253 }
254 else if(ev.id == RMI_SET_SENSITIVITY)
255 {
256 /* handle negative values as well ! */
257 rmi_write_single(RMI_2D_SENSITIVITY_ADJ, (unsigned char)(int8_t)ev.data);
258 continue;
259 }
248 else if(ev.id != RMI_INTERRUPT) 260 else if(ev.id != RMI_INTERRUPT)
249 continue; 261 continue;
250 /* clear interrupt */ 262 /* clear interrupt */