mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-27 07:46:24 -04:00
D2: Remove the hardcoded driver-level touchscreen calibration, since it's done at apps level as well now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23299 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9ce9cfc0a9
commit
d94c3c47f9
1 changed files with 3 additions and 33 deletions
|
|
@ -39,30 +39,13 @@ static int short_cmp(const void *a, const void *b)
|
||||||
return *(short*)a - *(short*)b;
|
return *(short*)a - *(short*)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct touch_calibration_point {
|
|
||||||
short px_x; /* known pixel value */
|
|
||||||
short px_y;
|
|
||||||
short val_x; /* touchscreen value at the known pixel */
|
|
||||||
short val_y;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct touch_calibration_point topleft, bottomright;
|
|
||||||
|
|
||||||
static int touch_to_pixels(short val_x, short val_y)
|
static int touch_to_pixels(short val_x, short val_y)
|
||||||
{
|
{
|
||||||
short x, y;
|
int x = (val_x * LCD_WIDTH) >> 10;
|
||||||
|
int y = (val_y * LCD_HEIGHT) >> 10;
|
||||||
x = val_x;
|
|
||||||
y = val_y;
|
|
||||||
|
|
||||||
x = (x - topleft.val_x) * (bottomright.px_x - topleft.px_x)
|
|
||||||
/ (bottomright.val_x - topleft.val_x) + topleft.px_x;
|
|
||||||
|
|
||||||
y = (y - topleft.val_y) * (bottomright.px_y - topleft.px_y)
|
|
||||||
/ (bottomright.val_y - topleft.val_y) + topleft.px_y;
|
|
||||||
|
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
else if (x >= LCD_WIDTH)
|
else if (x >= LCD_WIDTH)
|
||||||
x = LCD_WIDTH - 1;
|
x = LCD_WIDTH - 1;
|
||||||
|
|
||||||
|
|
@ -162,19 +145,6 @@ void touchscreen_init_device(void)
|
||||||
{
|
{
|
||||||
touch_available = false;
|
touch_available = false;
|
||||||
|
|
||||||
/* Arbitrary touchscreen calibration */
|
|
||||||
topleft.px_x = 0;
|
|
||||||
topleft.px_y = 0;
|
|
||||||
|
|
||||||
bottomright.px_x = LCD_WIDTH;
|
|
||||||
bottomright.px_y = LCD_HEIGHT;
|
|
||||||
|
|
||||||
topleft.val_x = 50;
|
|
||||||
topleft.val_y = 50;
|
|
||||||
|
|
||||||
bottomright.val_x = 980;
|
|
||||||
bottomright.val_y = 980;
|
|
||||||
|
|
||||||
if (get_pmu_type() != PCF50606)
|
if (get_pmu_type() != PCF50606)
|
||||||
{
|
{
|
||||||
tsc200x_init();
|
tsc200x_init();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue