summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-07-15 09:39:51 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-07-15 18:41:32 +0200
commit47785ca7f95c8a1e17bc1056a0d9afa0e7b53c5e (patch)
treeb4b78dd08aa340de624f1813b3aa4173b62709aa
parenta8cea3b71c7d40636be8bf311775d3a083f18cb4 (diff)
downloadrockbox-47785ca7f95c8a1e17bc1056a0d9afa0e7b53c5e.tar.gz
rockbox-47785ca7f95c8a1e17bc1056a0d9afa0e7b53c5e.zip
fuzeplus: add touchpad sensitivity
Change-Id: I0252c0967716a4f1a628191dcde7ffc80279370b Reviewed-on: http://gerrit.rockbox.org/515 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
-rw-r--r--firmware/export/config/sansafuzeplus.h5
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c14
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-target.h1
3 files changed, 19 insertions, 1 deletions
diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
index fda2390fb7..1c5c2e0193 100644
--- a/firmware/export/config/sansafuzeplus.h
+++ b/firmware/export/config/sansafuzeplus.h
@@ -87,6 +87,11 @@
87#define HAVE_SW_TONE_CONTROLS 87#define HAVE_SW_TONE_CONTROLS
88 88
89#define CONFIG_KEYPAD SANSA_FUZEPLUS_PAD 89#define CONFIG_KEYPAD SANSA_FUZEPLUS_PAD
90#define HAVE_TOUCHPAD
91#define HAVE_TOUCHPAD_SENSITIVITY_SETTING
92#define MIN_TOUCHPAD_SENSITIVITY_SETTING -25
93#define MAX_TOUCHPAD_SENSITIVITY_SETTING 25
94#define DEFAULT_TOUCHPAD_SENSITIVITY_SETTING 13
90 95
91/* Define this to enable morse code input */ 96/* Define this to enable morse code input */
92#define HAVE_MORSE_INPUT 97#define HAVE_MORSE_INPUT
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 */
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h
index b431c94f45..58e8d3179c 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h
@@ -23,6 +23,7 @@
23 23
24#include <stdbool.h> 24#include <stdbool.h>
25bool button_debug_screen(void); 25bool button_debug_screen(void);
26void touchpad_set_sensitivity(int level);
26 27
27/* Main unit's buttons */ 28/* Main unit's buttons */
28#define BUTTON_POWER 0x00000001 29#define BUTTON_POWER 0x00000001