summaryrefslogtreecommitdiffstats
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-47785ca.tar.gz
rockbox-47785ca.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 @@
#define HAVE_SW_TONE_CONTROLS
#define CONFIG_KEYPAD SANSA_FUZEPLUS_PAD
+#define HAVE_TOUCHPAD
+#define HAVE_TOUCHPAD_SENSITIVITY_SETTING
+#define MIN_TOUCHPAD_SENSITIVITY_SETTING -25
+#define MAX_TOUCHPAD_SENSITIVITY_SETTING 25
+#define DEFAULT_TOUCHPAD_SENSITIVITY_SETTING 13
/* Define this to enable morse code input */
#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[] =
{0, 0, 0, 0, 0},
};
-#define RMI_INTERRUPT 1
+#define RMI_INTERRUPT 1
+#define RMI_SET_SENSITIVITY 2
static int touchpad_btns = 0;
static long rmi_stack [DEFAULT_STACK_SIZE/sizeof(long)];
@@ -232,6 +233,11 @@ static void rmi_attn_cb(int bank, int pin, intptr_t user)
queue_post(&rmi_queue, RMI_INTERRUPT, 0);
}
+void touchpad_set_sensitivity(int level)
+{
+ queue_post(&rmi_queue, RMI_SET_SENSITIVITY, level);
+}
+
static void rmi_thread(void)
{
struct queue_event ev;
@@ -245,6 +251,12 @@ static void rmi_thread(void)
usb_acknowledge(SYS_USB_CONNECTED_ACK);
continue;
}
+ else if(ev.id == RMI_SET_SENSITIVITY)
+ {
+ /* handle negative values as well ! */
+ rmi_write_single(RMI_2D_SENSITIVITY_ADJ, (unsigned char)(int8_t)ev.data);
+ continue;
+ }
else if(ev.id != RMI_INTERRUPT)
continue;
/* 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 @@
#include <stdbool.h>
bool button_debug_screen(void);
+void touchpad_set_sensitivity(int level);
/* Main unit's buttons */
#define BUTTON_POWER 0x00000001