comparison src/video/fbcon/SDL_fbelo.c @ 4:4f6c5f021323

Date: Thu, 26 Apr 2001 10:46:23 +0200 From: Alexander Pipelka <pipelka@bms-austria.com> Subject: SDL ELO driver bugfix Hi Sam! We noticed that the ELO serial touchscreen controller is quite sensitive in terms of correct protocol handling. The current implementation cause some controllers to hangup after some time (> 24h). I think the attached patch should fix this (I ran my device more than 3 days without any hangups).
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:54:56 +0000
parents 74212992fb08
children 2cf88672fc7f
comparison
equal deleted inserted replaced
3:3b97b708523c 4:4f6c5f021323
419 return 0; 419 return 0;
420 } 420 }
421 421
422 return 1; 422 return 1;
423 } 423 }
424
425 int eloReadPosition(_THIS, int fd, int* x, int* y, int* button_state, int* realx, int* realy) {
426 unsigned char buffer[ELO_PACKET_SIZE];
427 int pointer = 0;
428 int checksum = ELO_INIT_CHECKSUM;
429
430 while(pointer < ELO_PACKET_SIZE) {
431 if(eloGetPacket(buffer, &pointer, &checksum, fd)) {
432 break;
433 }
434 }
435
436 if(!eloParsePacket(buffer, realx, realy, button_state)) {
437 return 0;
438 }
439
440 *x = *realx;
441 *y = *realy;
442
443 eloConvertXY(this, x, y);
444
445 return 1;
446 }