aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gdisp/SSD1963/gdisp_lld.c2
-rw-r--r--include/touchpad.h1
-rw-r--r--src/touchpad.c5
3 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gdisp/SSD1963/gdisp_lld.c b/drivers/gdisp/SSD1963/gdisp_lld.c
index 750affc4..2d8bacce 100644
--- a/drivers/gdisp/SSD1963/gdisp_lld.c
+++ b/drivers/gdisp/SSD1963/gdisp_lld.c
@@ -320,7 +320,7 @@ bool_t GDISP_LLD(init)(void) {
GDISP_LLD(writeindex)(SSD1963_SET_DISPLAY_ON);
#if defined(LCD_USE_FSMC)
/* FSMC delay reduced as the controller now runs at full speed */
- FSMC_Bank1->BTCR[FSMC_Bank+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_1 | FSMC_BTR1_BUSTURN_0 ;
+ FSMC_Bank1->BTCR[FSMC_Bank+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0 ;
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
#endif
diff --git a/include/touchpad.h b/include/touchpad.h
index 55a83a9d..34c00e5d 100644
--- a/include/touchpad.h
+++ b/include/touchpad.h
@@ -73,6 +73,7 @@ extern "C" {
void tpInit(const TOUCHPADDriver *tp);
uint16_t tpReadX(void);
uint16_t tpReadY(void);
+void tpCalibrate(void);
#if TOUCHPAD_HAS_IRQ
uint8_t tpIRQ(void);
diff --git a/src/touchpad.c b/src/touchpad.c
index 44d5f426..5e81738b 100644
--- a/src/touchpad.c
+++ b/src/touchpad.c
@@ -196,11 +196,12 @@ uint16_t tpReadY(void) {
}
void tpCalibrate(void) {
- uint16_t cross[2][2] = {{40,50}, {200, 280}};
+ const uint16_t h = gdispGetHeight();
+ const uint16_t w = gdispGetWidth();
+ const uint16_t cross[2][2] = {{(w/8), (h/8)}, {(w-(w/8)) , (h-(h/8))}};
uint16_t points[2][2];
uint8_t i;
- //gdispSetOrientation(portrait);
gdispClear(Red);
gdispFillStringBox(0, 10, gdispGetWidth(), 30, "Calibration", &fontUI2Double, White, Red, justifyCenter);