summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 fda2390..1c5c2e0 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 ad0dd16..1474e06 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 b431c94..58e8d31 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