fuzeplus: add touchpad sensitivity

Change-Id: I0252c0967716a4f1a628191dcde7ffc80279370b
Reviewed-on: http://gerrit.rockbox.org/515
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
This commit is contained in:
Amaury Pouly 2013-07-15 09:39:51 +02:00
parent a8cea3b71c
commit 47785ca7f9
3 changed files with 19 additions and 1 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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