touchscreen fixes
This commit is contained in:
parent
8231e9738c
commit
5f90362261
@ -53,8 +53,6 @@ TouchscreenDriver TOUCHPADD1 = {
|
||||
|
||||
void drawScreen(void) {
|
||||
char *msg = "ChibiOS/GFX";
|
||||
uint16_t colorsize = COLOR_SIZE;
|
||||
uint16_t pensize = PEN_SIZE;
|
||||
|
||||
gdispSetOrientation(GDISP_ROTATE_90);
|
||||
gdispClear(White);
|
||||
@ -86,7 +84,6 @@ int main(void) {
|
||||
|
||||
gdispInit();
|
||||
tsInit(&TOUCHPADD1);
|
||||
tsCalibrate();
|
||||
|
||||
drawScreen();
|
||||
|
||||
|
@ -31,6 +31,14 @@
|
||||
|
||||
#if GFX_USE_TOUCHSCREEN || defined(__DOXYGEN__)
|
||||
|
||||
#ifndef TOUCHSCREEN_STORE_CALIBRATION
|
||||
#define TOUCHSCREEN_STORE_CALIBRATION FALSE
|
||||
#endif
|
||||
|
||||
#ifndef TOUCHSCREEN_VERIFY_CALIBRATION
|
||||
#define TOUCHSCREEN_VERIFY_CALIBRATION FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief specifies how many conversions are made for a readout.
|
||||
*
|
||||
|
@ -49,14 +49,6 @@
|
||||
#define TOUCHSCREEN_XY_INVERTED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef TOUCHSCREEN_STORE_CALIBRATION
|
||||
#define TOUCHSCREEN_STORE_CALIBRATION FALSE
|
||||
#endif
|
||||
|
||||
#ifndef TOUCHSCREEN_VERIFY_CALIBRATION
|
||||
#define TOUCHSCREEN_VERIFY_CALIBRATION FALSE
|
||||
#endif
|
||||
|
||||
#ifndef TOUCHSCREEN_HAS_IRQ
|
||||
#define TOUCHSCREEN_HAS_IRQ FALSE
|
||||
#endif
|
||||
|
@ -159,7 +159,6 @@ static void _tsDo3PointCalibration(const coord_t (*cross)[2], coord_t (*points)[
|
||||
* @api
|
||||
*/
|
||||
void tsInit(const TouchscreenDriver *ts) {
|
||||
|
||||
/* Initialise Mutex */
|
||||
//MUTEX_INIT
|
||||
|
||||
@ -177,6 +176,7 @@ void tsInit(const TouchscreenDriver *ts) {
|
||||
cal = (struct cal_t*)chHeapAlloc(NULL, sizeof(struct cal_t));
|
||||
if(cal == NULL)
|
||||
return;
|
||||
|
||||
tsCalibrate();
|
||||
}
|
||||
|
||||
@ -206,9 +206,9 @@ coord_t tsReadX(void) {
|
||||
case GDISP_ROTATE_90:
|
||||
return y;
|
||||
case GDISP_ROTATE_180:
|
||||
return gdispGetWidth() - x - 1;
|
||||
return GDISP_SCREEN_WIDTH - x - 1;
|
||||
case GDISP_ROTATE_270:
|
||||
return gdispGetHeight() - y - 1;
|
||||
return GDISP_SCREEN_HEIGHT - y - 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -238,9 +238,9 @@ coord_t tsReadY(void) {
|
||||
case GDISP_ROTATE_0:
|
||||
return y;
|
||||
case GDISP_ROTATE_90:
|
||||
return gdispGetWidth() - x - 1;
|
||||
return GDISP_SCREEN_WIDTH - x - 1;
|
||||
case GDISP_ROTATE_180:
|
||||
return gdispGetHeight() - y - 1;
|
||||
return GDISP_SCREEN_HEIGHT - y - 1;
|
||||
case GDISP_ROTATE_270:
|
||||
return x;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user