@@ -72,8 +72,8 @@ uint8_t tft_image_debug = 0;
72
72
73
73
float tft_angleOffset = DEFAULT_ANGLE_OFFSET ;
74
74
75
- int TFT_X = 0 ;
76
- int TFT_Y = 0 ;
75
+ int tft_x = 0 ;
76
+ int tft_y = 0 ;
77
77
78
78
uint32_t tft_tp_calx = 7472920 ;
79
79
uint32_t tft_tp_caly = 122224794 ;
@@ -1750,8 +1750,8 @@ static void rotateChar(uint8_t c, int x, int y, int pos) {
1750
1750
}
1751
1751
disp_deselect ();
1752
1752
// calculate x,y for the next char
1753
- TFT_X = (int )(x + ((pos + 1 ) * tft_cfont .x_size * cos_radian ));
1754
- TFT_Y = (int )(y + ((pos + 1 ) * tft_cfont .x_size * sin_radian ));
1753
+ tft_x = (int )(x + ((pos + 1 ) * tft_cfont .x_size * cos_radian ));
1754
+ tft_y = (int )(y + ((pos + 1 ) * tft_cfont .x_size * sin_radian ));
1755
1755
}
1756
1756
1757
1757
//----------------------
@@ -1931,10 +1931,10 @@ void TFT_print(char *st, int x, int y) {
1931
1931
1932
1932
if ((x < LASTX ) || (tft_font_rotate == 0 )) TFT_OFFSET = 0 ;
1933
1933
1934
- if ((x >= LASTX ) && (x < LASTY )) x = TFT_X + (x - LASTX );
1934
+ if ((x >= LASTX ) && (x < LASTY )) x = tft_x + (x - LASTX );
1935
1935
else if (x > CENTER ) x += tft_dispWin .x1 ;
1936
1936
1937
- if (y >= LASTY ) y = TFT_Y + (y - LASTY );
1937
+ if (y >= LASTY ) y = tft_y + (y - LASTY );
1938
1938
else if (y > CENTER ) y += tft_dispWin .y1 ;
1939
1939
1940
1940
// ** Get number of characters in string to print
@@ -1958,8 +1958,8 @@ void TFT_print(char *st, int x, int y) {
1958
1958
if (y < tft_dispWin .y1 ) y = tft_dispWin .y1 ;
1959
1959
if ((x > tft_dispWin .x2 ) || (y > tft_dispWin .y2 )) return ;
1960
1960
1961
- TFT_X = x ;
1962
- TFT_Y = y ;
1961
+ tft_x = x ;
1962
+ tft_y = y ;
1963
1963
1964
1964
// ** Adjust y position
1965
1965
tmph = tft_cfont .y_size ; // font height
@@ -1973,22 +1973,22 @@ void TFT_print(char *st, int x, int y) {
1973
1973
}
1974
1974
else TFT_OFFSET = 0 ; // fixed font; offset not needed
1975
1975
1976
- if ((TFT_Y + tmph - 1 ) > tft_dispWin .y2 ) return ;
1976
+ if ((tft_y + tmph - 1 ) > tft_dispWin .y2 ) return ;
1977
1977
1978
1978
int offset = TFT_OFFSET ;
1979
1979
1980
1980
for (i = 0 ; i < stl ; i ++ ) {
1981
1981
ch = st [i ]; // get string character
1982
1982
1983
1983
if (ch == 0x0D ) { // === '\r', erase to eol ====
1984
- if ((!tft_font_transparent ) && (tft_font_rotate == 0 )) _fillRect (TFT_X , TFT_Y , tft_dispWin .x2 + 1 - TFT_X , tmph , tft_bg );
1984
+ if ((!tft_font_transparent ) && (tft_font_rotate == 0 )) _fillRect (tft_x , tft_y , tft_dispWin .x2 + 1 - tft_x , tmph , tft_bg );
1985
1985
}
1986
1986
1987
1987
else if (ch == 0x0A ) { // ==== '\n', new line ====
1988
1988
if (tft_cfont .bitmap == 1 ) {
1989
- TFT_Y += tmph + tft_font_line_space ;
1990
- if (TFT_Y > (tft_dispWin .y2 - tmph )) break ;
1991
- TFT_X = tft_dispWin .x1 ;
1989
+ tft_y += tmph + tft_font_line_space ;
1990
+ if (tft_y > (tft_dispWin .y2 - tmph )) break ;
1991
+ tft_x = tft_dispWin .x1 ;
1992
1992
}
1993
1993
}
1994
1994
@@ -2000,17 +2000,17 @@ void TFT_print(char *st, int x, int y) {
2000
2000
}
2001
2001
2002
2002
// check if character can be displayed in the current line
2003
- if ((TFT_X + tmpw ) > (tft_dispWin .x2 )) {
2003
+ if ((tft_x + tmpw ) > (tft_dispWin .x2 )) {
2004
2004
if (tft_text_wrap == 0 ) break ;
2005
- TFT_Y += tmph + tft_font_line_space ;
2006
- if (TFT_Y > (tft_dispWin .y2 - tmph )) break ;
2007
- TFT_X = tft_dispWin .x1 ;
2005
+ tft_y += tmph + tft_font_line_space ;
2006
+ if (tft_y > (tft_dispWin .y2 - tmph )) break ;
2007
+ tft_x = tft_dispWin .x1 ;
2008
2008
}
2009
2009
2010
2010
// Let's print the character
2011
2011
if (tft_cfont .x_size == 0 ) {
2012
2012
// == proportional font
2013
- if (tft_font_rotate == 0 ) TFT_X += printProportionalChar (TFT_X , TFT_Y ) + 1 ;
2013
+ if (tft_font_rotate == 0 ) tft_x += printProportionalChar (tft_x , tft_y ) + 1 ;
2014
2014
else {
2015
2015
// rotated proportional font
2016
2016
offset += rotatePropChar (x , y , offset );
@@ -2022,15 +2022,15 @@ void TFT_print(char *st, int x, int y) {
2022
2022
// == fixed font
2023
2023
if ((ch < tft_cfont .offset ) || ((ch - tft_cfont .offset ) > tft_cfont .numchars )) ch = tft_cfont .offset ;
2024
2024
if (tft_font_rotate == 0 ) {
2025
- printChar (ch , TFT_X , TFT_Y );
2026
- TFT_X += tmpw ;
2025
+ printChar (ch , tft_x , tft_y );
2026
+ tft_x += tmpw ;
2027
2027
}
2028
2028
else rotateChar (ch , x , y , i );
2029
2029
}
2030
2030
else if (tft_cfont .bitmap == 2 ) {
2031
2031
// == 7-segment font ==
2032
- _draw7seg (TFT_X , TFT_Y , ch , tft_cfont .y_size , tft_cfont .x_size , tft_fg );
2033
- TFT_X += (tmpw + 2 );
2032
+ _draw7seg (tft_x , tft_y , ch , tft_cfont .y_size , tft_cfont .x_size , tft_fg );
2033
+ tft_x += (tmpw + 2 );
2034
2034
}
2035
2035
}
2036
2036
}
0 commit comments