|
391 | 391 | #define BEEPER_PIN 42 |
392 | 392 |
|
393 | 393 | #define TOUCH_CS_PIN 33 |
| 394 | + |
394 | 395 | #define SD_DETECT_PIN 41 |
395 | 396 |
|
396 | 397 | #define HAS_SPI_FLASH 1 |
|
407 | 408 | #ifndef TFT_DRIVER |
408 | 409 | #define TFT_DRIVER ST7796 |
409 | 410 | #endif |
410 | | - #ifndef XPT2046_X_CALIBRATION |
411 | | - #define XPT2046_X_CALIBRATION 63934 |
412 | | - #endif |
413 | | - #ifndef XPT2046_Y_CALIBRATION |
414 | | - #define XPT2046_Y_CALIBRATION 63598 |
415 | | - #endif |
416 | | - #ifndef XPT2046_X_OFFSET |
417 | | - #define XPT2046_X_OFFSET -1 |
418 | | - #endif |
419 | | - #ifndef XPT2046_Y_OFFSET |
420 | | - #define XPT2046_Y_OFFSET -20 |
| 411 | + #ifndef TOUCH_SCREEN_CALIBRATION |
| 412 | + #if ENABLED(TFT_RES_320x240) |
| 413 | + #ifndef TOUCH_CALIBRATION_X |
| 414 | + #define TOUCH_CALIBRATION_X 20525 |
| 415 | + #endif |
| 416 | + #ifndef TOUCH_CALIBRATION_Y |
| 417 | + #define TOUCH_CALIBRATION_Y 15335 |
| 418 | + #endif |
| 419 | + #ifndef TOUCH_OFFSET_X |
| 420 | + #define TOUCH_OFFSET_X -1 |
| 421 | + #endif |
| 422 | + #ifndef TOUCH_OFFSET_Y |
| 423 | + #define TOUCH_OFFSET_Y 0 |
| 424 | + #endif |
| 425 | + #elif ENABLED(TFT_RES_480x272) |
| 426 | + #ifndef TOUCH_CALIBRATION_X |
| 427 | + #define TOUCH_CALIBRATION_X 30715 |
| 428 | + #endif |
| 429 | + #ifndef TOUCH_CALIBRATION_Y |
| 430 | + #define TOUCH_CALIBRATION_Y 17415 |
| 431 | + #endif |
| 432 | + #ifndef TOUCH_OFFSET_X |
| 433 | + #define TOUCH_OFFSET_X 0 |
| 434 | + #endif |
| 435 | + #ifndef TOUCH_OFFSET_Y |
| 436 | + #define TOUCH_OFFSET_Y -1 |
| 437 | + #endif |
| 438 | + #elif ENABLED(TFT_RES_480x320) |
| 439 | + #ifndef TOUCH_CALIBRATION_X |
| 440 | + #define TOUCH_CALIBRATION_X 30595 |
| 441 | + #endif |
| 442 | + #ifndef TOUCH_CALIBRATION_Y |
| 443 | + #define TOUCH_CALIBRATION_Y 20415 |
| 444 | + #endif |
| 445 | + #ifndef TOUCH_OFFSET_X |
| 446 | + #define TOUCH_OFFSET_X 2 |
| 447 | + #endif |
| 448 | + #ifndef TOUCH_OFFSET_Y |
| 449 | + #define TOUCH_OFFSET_Y 1 |
| 450 | + #endif |
| 451 | + #endif |
421 | 452 | #endif |
422 | 453 |
|
423 | 454 | #define BTN_BACK 70 |
|
0 commit comments