@@ -43,19 +43,17 @@ void graphics::init()
43
43
#endif
44
44
45
45
lcd->init ();
46
- lcd->setBrightness (0xFF );
46
+ lcd->setBrightness (0xFF / 3 );
47
47
lcd->setColorDepth (16 );
48
48
lcd->setTextColor (TFT_WHITE);
49
- lcd->fillScreen (TFT_BLACK);
50
-
51
- lcd->startWrite (); // Keep the SPI Bus busy ?
49
+ lcd->fillScreen (TFT_RED);
52
50
53
51
#ifdef ESP_PLATFORM
54
52
// uint16_t calibrationData[8];
55
53
// lcd->calibrateTouch(calibrationData, TFT_MAGENTA, TFT_BLACK);
56
54
57
55
// Please do a real calibration thing... (see above)
58
- uint16_t calibrationData[] = {
56
+ /* uint16_t calibrationData[] = {
59
57
390,
60
58
170,
61
59
350,
@@ -66,7 +64,7 @@ void graphics::init()
66
64
3950
67
65
};
68
66
69
- lcd->setTouchCalibrate (calibrationData);
67
+ lcd->setTouchCalibrate(calibrationData);*/
70
68
#endif
71
69
}
72
70
@@ -125,7 +123,7 @@ void graphics::SDLInit(void (*appMain)())
125
123
// You should only use this function with a "Canvas" (Surface that is the size of the screen)
126
124
void graphics::showSurface (const Surface* surface, int x, int y)
127
125
{
128
- if (x != 0 || y != 0 )
126
+ /* if (x != 0 || y != 0)
129
127
{
130
128
std::cerr << "---------------------------------------------------------------------------------------------------------------------" << std::endl;
131
129
std::cerr << " Warning ! " << std::endl;
@@ -135,7 +133,7 @@ void graphics::showSurface(const Surface* surface, int x, int y)
135
133
std::cerr << ">>> Please push to a 'graphics::Surface' before pushing to the screen. <<<" << std::endl;
136
134
std::cerr << ">>> By using a 'graphics::Surface' before pusing to the screen, you are also enabling double buffering rendering. <<<" << std::endl;
137
135
std::cerr << "---------------------------------------------------------------------------------------------------------------------" << std::endl;
138
- }
136
+ }*/
139
137
140
138
lgfx::LGFX_Sprite sprite = surface->m_sprite ; // we are friends !
141
139
@@ -153,8 +151,11 @@ void graphics::getTouchPos(int16_t* x, int16_t* y)
153
151
int16_t ty;
154
152
155
153
lcd->getTouch (&tx, &ty);
154
+ #ifdef ESP_PLATFORM // with capacitive touch?
155
+ ty = ty * 480 / 700 ;
156
+ #endif
156
157
157
- if (tx < 0 || ty < 0 || tx > graphics::getScreenWidth () || ty > graphics::getScreenHeight ())
158
+ if (tx <= 0 || ty <= 0 || tx > graphics::getScreenWidth () || ty > graphics::getScreenHeight ())
158
159
{
159
160
// Be sure to be offscreen
160
161
*x = -1 ;
0 commit comments