@@ -79,10 +79,10 @@ uint32_t tft_tp_calx = 7472920;
7979uint32_t tft_tp_caly = 122224794 ;
8080
8181dispWin_t tft_dispWin = {
82- .x1 = 0 ,
83- .y1 = 0 ,
84- .x2 = DEFAULT_TFT_DISPLAY_WIDTH ,
85- .y2 = DEFAULT_TFT_DISPLAY_HEIGHT ,
82+ .x1 = TFT_STATIC_WIDTH_OFFSET ,
83+ .y1 = TFT_STATIC_HEIGHT_OFFSET ,
84+ .x2 = DEFAULT_TFT_DISPLAY_WIDTH + TFT_STATIC_WIDTH_OFFSET ,
85+ .y2 = DEFAULT_TFT_DISPLAY_HEIGHT + TFT_STATIC_HEIGHT_OFFSET ,
8686};
8787
8888Font tft_cfont = {
@@ -296,7 +296,7 @@ void TFT_fillRect(int16_t x, int16_t y, int16_t w, int16_t h, color_t color) {
296296
297297//==================================
298298void TFT_fillScreen (color_t color ) {
299- TFT_pushColorRep (0 , 0 , tft_width - 1 , tft_height - 1 , color , (uint32_t )(tft_height * tft_width ));
299+ TFT_pushColorRep (TFT_STATIC_X_OFFSET , TFT_STATIC_Y_OFFSET , tft_width + TFT_STATIC_X_OFFSET - 1 , tft_height + TFT_STATIC_Y_OFFSET - 1 , color , (uint32_t )(tft_height * tft_width ));
300300}
301301
302302//==================================
@@ -2056,10 +2056,10 @@ void TFT_setRotation(uint8_t rot) {
20562056 _tft_setRotation (rot );
20572057 }
20582058
2059- tft_dispWin .x1 = 0 ;
2060- tft_dispWin .y1 = 0 ;
2061- tft_dispWin .x2 = tft_width - 1 ;
2062- tft_dispWin .y2 = tft_height - 1 ;
2059+ tft_dispWin .x1 = TFT_STATIC_X_OFFSET ;
2060+ tft_dispWin .y1 = TFT_STATIC_Y_OFFSET ;
2061+ tft_dispWin .x2 = tft_width + TFT_STATIC_X_OFFSET - 1 ;
2062+ tft_dispWin .y2 = tft_height + TFT_STATIC_Y_OFFSET - 1 ;
20632063
20642064 TFT_fillScreen (tft_bg );
20652065}
@@ -2157,24 +2157,24 @@ color_t HSBtoRGB(float _hue, float _sat, float _brightness) {
21572157//=====================================================================
21582158void TFT_setclipwin (uint16_t x1 , uint16_t y1 , uint16_t x2 , uint16_t y2 )
21592159{
2160- tft_dispWin .x1 = x1 ;
2161- tft_dispWin .y1 = y1 ;
2162- tft_dispWin .x2 = x2 ;
2163- tft_dispWin .y2 = y2 ;
2160+ tft_dispWin .x1 = x1 + TFT_STATIC_X_OFFSET ;
2161+ tft_dispWin .y1 = y1 + TFT_STATIC_Y_OFFSET ;
2162+ tft_dispWin .x2 = x2 + TFT_STATIC_X_OFFSET ;
2163+ tft_dispWin .y2 = y2 + TFT_STATIC_Y_OFFSET ;
21642164
2165- if (tft_dispWin .x2 >= tft_width ) tft_dispWin .x2 = tft_width - 1 ;
2166- if (tft_dispWin .y2 >= tft_height ) tft_dispWin .y2 = tft_height - 1 ;
2165+ if (tft_dispWin .x2 >= tft_width + TFT_STATIC_X_OFFSET ) tft_dispWin .x2 = tft_width + TFT_STATIC_X_OFFSET - 1 ;
2166+ if (tft_dispWin .y2 >= tft_height + TFT_STATIC_Y_OFFSET ) tft_dispWin .y2 = tft_height + TFT_STATIC_Y_OFFSET - 1 ;
21672167 if (tft_dispWin .x1 > tft_dispWin .x2 ) tft_dispWin .x1 = tft_dispWin .x2 ;
21682168 if (tft_dispWin .y1 > tft_dispWin .y2 ) tft_dispWin .y1 = tft_dispWin .y2 ;
21692169}
21702170
21712171//=====================
21722172void TFT_resetclipwin ()
21732173{
2174- tft_dispWin .x2 = tft_width - 1 ;
2175- tft_dispWin .y2 = tft_height - 1 ;
2176- tft_dispWin .x1 = 0 ;
2177- tft_dispWin .y1 = 0 ;
2174+ tft_dispWin .x2 = tft_width + TFT_STATIC_X_OFFSET - 1 ;
2175+ tft_dispWin .y2 = tft_height + TFT_STATIC_Y_OFFSET - 1 ;
2176+ tft_dispWin .x1 = TFT_STATIC_X_OFFSET ;
2177+ tft_dispWin .y1 = TFT_STATIC_Y_OFFSET ;
21782178}
21792179
21802180//==========================================================================
0 commit comments