@@ -22,8 +22,6 @@ class TouchScreenCalibrator : public CustomDrawing {
2222 MenuTouchScreenManager* touchScreen;
2323 int oldX= 0 , oldY=0 ;
2424 unsigned int takeOverCount=0 ;
25- iotouch::TouchInterrogator::TouchRotation oldRotation = iotouch::TouchInterrogator::PORTRAIT;
26- uint8_t oldTftRotation = 0 ;
2725public:
2826 explicit TouchScreenCalibrator (MenuTouchScreenManager *touchScreen)
2927 : drawable(nullptr ), touchScreen(touchScreen) {}
@@ -36,9 +34,6 @@ class TouchScreenCalibrator : public CustomDrawing {
3634 if (renderer.getRendererType () != RENDER_TYPE_CONFIGURABLE) {
3735 renderer.giveBackDisplay (); // we cannot work with non configurable rendering
3836 }
39- oldTftRotation = tft.getRotation ();
40- oldRotation = touchScreen->changeRotation (iotouch::TouchInterrogator::RAW);
41- tft.setRotation (0 );
4237 drawable = reinterpret_cast <GraphicsDeviceRenderer*>(currentRenderer)->getDeviceDrawable ();
4338 drawable->startDraw ();
4439 drawable->setDrawColor (TFT_BLACK);
@@ -48,6 +43,7 @@ class TouchScreenCalibrator : public CustomDrawing {
4843 }
4944
5045 void renderLoop (unsigned int currentValue, RenderPressMode userClick) override {
46+
5147 drawable->startDraw ();
5248 drawable->setDrawColor (TFT_BLACK);
5349 drawable->drawCircle (Coord (oldX, oldY), 10 , true );
@@ -73,8 +69,6 @@ class TouchScreenCalibrator : public CustomDrawing {
7369 drawable->drawCircle (Coord (oldX, oldY), 10 , true );
7470
7571 if (oldX < 40 && oldY < 40 && touchScreen->getLastTouchState () == iotouch::HELD) {
76- tft.setRotation (oldTftRotation);
77- touchScreen->changeRotation (oldRotation);
7872 renderer.giveBackDisplay ();
7973 }
8074 }
0 commit comments