uncommited code for 151 release (PSP suspend, file browser, etc)

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@554 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-07-18 13:04:38 +00:00
parent f0f0d2df76
commit 2b02d6e533
9 changed files with 79 additions and 58 deletions

View file

@ -237,12 +237,12 @@ int gp2x_touchpad_read(int *x, int *y)
if (touchdev < 0) return -1;
retval = read(touchdev, &event, sizeof(event));
if (retval < 0) {
if (retval <= 0) {
printf("touch read failed %i %i\n", retval, errno);
return -1;
}
// this is to ignore the messed-up 4.1.x driver
if (retval == 0) zero_seen = 1;
if (event.pressure == 0) zero_seen = 1;
if (x) *x = (event.x * touchcal[0] + touchcal[2]) >> 16;
if (y) *y = (event.y * touchcal[4] + touchcal[5]) >> 16;