@@ -364,14 +364,14 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
364
364
365
365
#if ENABLED(SHOW_BOOTSCREEN)
366
366
367
- void lcd_erase_line (const int16_t line) {
367
+ void lcd_erase_line (const lcd_uint_t line) {
368
368
lcd_moveto (0 , line);
369
369
for (uint8_t i = LCD_WIDTH + 1 ; --i;)
370
370
lcd_put_wchar (' ' );
371
371
}
372
372
373
373
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
374
- void lcd_scroll (const uint8_t col, const uint8_t line, PGM_P const text, const uint8_t len, const int16_t time) {
374
+ void lcd_scroll (const lcd_uint_t col, const lcd_uint_t line, PGM_P const text, const uint8_t len, const int16_t time) {
375
375
uint8_t slen = utf8_strlen_P (text);
376
376
if (slen < len) {
377
377
// Fits into,
@@ -1031,9 +1031,9 @@ void MarlinUI::draw_status_screen() {
1031
1031
if (value != nullptr ) {
1032
1032
lcd_put_wchar (' :' );
1033
1033
int len = utf8_strlen (value);
1034
- const uint8_t valrow = (utf8_strlen_P (pstr) + 1 + len + 1 ) > (LCD_WIDTH - 2 ) ? 2 : 1 ; // Value on the next row if it won't fit
1035
- lcd_moveto ((LCD_WIDTH - 1 ) - (len + 1 ), valrow); // Right-justified, padded by spaces
1036
- lcd_put_wchar (' ' ); // Overwrite char if value gets shorter
1034
+ const lcd_uint_t valrow = (utf8_strlen_P (pstr) + 1 + len + 1 ) > (LCD_WIDTH - 2 ) ? 2 : 1 ; // Value on the next row if it won't fit
1035
+ lcd_moveto ((LCD_WIDTH - 1 ) - (len + 1 ), valrow); // Right-justified, padded by spaces
1036
+ lcd_put_wchar (' ' ); // Overwrite char if value gets shorter
1037
1037
lcd_put_u8str (value);
1038
1038
}
1039
1039
}
@@ -1144,9 +1144,9 @@ void MarlinUI::draw_status_screen() {
1144
1144
} custom_char;
1145
1145
1146
1146
typedef struct {
1147
- uint8_t column, row,
1148
- x_pixel_offset, y_pixel_offset,
1149
- x_pixel_mask;
1147
+ lcd_uint_t column, row,
1148
+ x_pixel_offset, y_pixel_offset;
1149
+ uint8_t x_pixel_mask;
1150
1150
} coordinate;
1151
1151
1152
1152
void add_edges_to_custom_char (custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location);
@@ -1174,16 +1174,16 @@ void MarlinUI::draw_status_screen() {
1174
1174
return ret_val;
1175
1175
}
1176
1176
1177
- inline coordinate pixel_location (const uint8_t x, const uint8_t y) { return pixel_location ((int16_t )x, (int16_t )y); }
1177
+ inline coordinate pixel_location (const lcd_uint_t x, const lcd_uint_t y) { return pixel_location ((int16_t )x, (int16_t )y); }
1178
1178
1179
- void prep_and_put_map_char (custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const uint8_t x, const uint8_t y) {
1179
+ void prep_and_put_map_char (custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const lcd_uint_t x, const lcd_uint_t y) {
1180
1180
add_edges_to_custom_char (chrdata, ul, lr, brc, cl);
1181
1181
lcd.createChar (c, (uint8_t *)&chrdata);
1182
1182
lcd_moveto (x, y);
1183
1183
lcd_put_wchar (c);
1184
1184
}
1185
1185
1186
- void MarlinUI::ubl_plot (const uint8_t x , const uint8_t inverted_y ) {
1186
+ void MarlinUI::ubl_plot (const uint8_t x_plot , const uint8_t y_plot ) {
1187
1187
1188
1188
#if LCD_WIDTH >= 20
1189
1189
#define _LCD_W_POS 12
@@ -1209,24 +1209,24 @@ void MarlinUI::draw_status_screen() {
1209
1209
* Show X and Y positions
1210
1210
*/
1211
1211
_XLABEL (_PLOT_X, 0 );
1212
- lcd_put_u8str (ftostr52 (LOGICAL_X_POSITION (pgm_read_float (&ubl._mesh_index_to_xpos [x ]))));
1212
+ lcd_put_u8str (ftostr52 (LOGICAL_X_POSITION (pgm_read_float (&ubl._mesh_index_to_xpos [x_plot ]))));
1213
1213
1214
1214
_YLABEL (_LCD_W_POS, 0 );
1215
- lcd_put_u8str (ftostr52 (LOGICAL_Y_POSITION (pgm_read_float (&ubl._mesh_index_to_ypos [inverted_y ]))));
1215
+ lcd_put_u8str (ftostr52 (LOGICAL_Y_POSITION (pgm_read_float (&ubl._mesh_index_to_ypos [y_plot ]))));
1216
1216
1217
1217
lcd_moveto (_PLOT_X, 0 );
1218
1218
1219
1219
#else // 16x4 or 20x4 display
1220
1220
1221
1221
coordinate upper_left, lower_right, bottom_right_corner;
1222
1222
custom_char new_char;
1223
- uint8_t i, j, k, l, m, n, n_rows, n_cols, y,
1224
- bottom_line, right_edge,
1225
- x_map_pixels, y_map_pixels,
1226
- pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt,
1227
- suppress_x_offset = 0 , suppress_y_offset = 0 ;
1223
+ uint8_t i, n, n_rows, n_cols;
1224
+ lcd_uint_t j, k, l, m, bottom_line, right_edge,
1225
+ x_map_pixels, y_map_pixels,
1226
+ pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt,
1227
+ suppress_x_offset = 0 , suppress_y_offset = 0 ;
1228
1228
1229
- y = GRID_MAX_POINTS_Y - inverted_y - 1 ;
1229
+ const uint8_t y_plot_inv = ( GRID_MAX_POINTS_Y - 1 ) - y_plot ;
1230
1230
1231
1231
upper_left.column = 0 ;
1232
1232
upper_left.row = 0 ;
@@ -1310,12 +1310,12 @@ void MarlinUI::draw_status_screen() {
1310
1310
new_char.custom_char_bits [j] = (uint8_t )_BV (i); // Char #3 is used for the box right edge
1311
1311
lcd.createChar (CHAR_EDGE_R, (uint8_t *)&new_char);
1312
1312
1313
- i = x * pixels_per_x_mesh_pnt - suppress_x_offset;
1314
- j = y * pixels_per_y_mesh_pnt - suppress_y_offset;
1313
+ i = x_plot * pixels_per_x_mesh_pnt - suppress_x_offset;
1314
+ j = y_plot_inv * pixels_per_y_mesh_pnt - suppress_y_offset;
1315
1315
upper_left = pixel_location (i, j);
1316
1316
1317
- k = (x + 1 ) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset;
1318
- l = (y + 1 ) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset;
1317
+ k = (x_plot + 1 ) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset;
1318
+ l = (y_plot_inv + 1 ) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset;
1319
1319
lower_right = pixel_location (k, l);
1320
1320
1321
1321
bottom_right_corner = pixel_location (x_map_pixels, y_map_pixels);
@@ -1327,7 +1327,7 @@ void MarlinUI::draw_status_screen() {
1327
1327
*/
1328
1328
1329
1329
clear_custom_char (&new_char);
1330
- const uint8_t ypix = _MIN (upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT);
1330
+ const lcd_uint_t ypix = _MIN (upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT);
1331
1331
for (j = upper_left.y_pixel_offset ; j < ypix; j++) {
1332
1332
i = upper_left.x_pixel_mask ;
1333
1333
for (k = 0 ; k < pixels_per_x_mesh_pnt; k++) {
@@ -1400,9 +1400,9 @@ void MarlinUI::draw_status_screen() {
1400
1400
*/
1401
1401
lcd_moveto (_LCD_W_POS, 0 );
1402
1402
lcd_put_wchar (' (' );
1403
- lcd_put_u8str (ui8tostr3 (x ));
1403
+ lcd_put_u8str (ui8tostr3 (x_plot ));
1404
1404
lcd_put_wchar (' ,' );
1405
- lcd_put_u8str (ui8tostr3 (inverted_y ));
1405
+ lcd_put_u8str (ui8tostr3 (y_plot ));
1406
1406
lcd_put_wchar (' )' );
1407
1407
1408
1408
#if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
@@ -1411,8 +1411,8 @@ void MarlinUI::draw_status_screen() {
1411
1411
* Print Z values
1412
1412
*/
1413
1413
_ZLABEL (_LCD_W_POS, 1 );
1414
- if (!isnan (ubl.z_values [x][inverted_y ]))
1415
- lcd_put_u8str (ftostr43sign (ubl.z_values [x][inverted_y ]));
1414
+ if (!isnan (ubl.z_values [x_plot][y_plot ]))
1415
+ lcd_put_u8str (ftostr43sign (ubl.z_values [x_plot][y_plot ]));
1416
1416
else
1417
1417
lcd_put_u8str_P (PSTR (" -----" ));
1418
1418
@@ -1422,16 +1422,16 @@ void MarlinUI::draw_status_screen() {
1422
1422
* Show all values at right of screen
1423
1423
*/
1424
1424
_XLABEL (_LCD_W_POS, 1 );
1425
- lcd_put_u8str (ftostr52 (LOGICAL_X_POSITION (pgm_read_float (&ubl._mesh_index_to_xpos [x ]))));
1425
+ lcd_put_u8str (ftostr52 (LOGICAL_X_POSITION (pgm_read_float (&ubl._mesh_index_to_xpos [x_plot ]))));
1426
1426
_YLABEL (_LCD_W_POS, 2 );
1427
- lcd_put_u8str (ftostr52 (LOGICAL_Y_POSITION (pgm_read_float (&ubl._mesh_index_to_ypos [inverted_y ]))));
1427
+ lcd_put_u8str (ftostr52 (LOGICAL_Y_POSITION (pgm_read_float (&ubl._mesh_index_to_ypos [y_plot ]))));
1428
1428
1429
1429
/* *
1430
1430
* Show the location value
1431
1431
*/
1432
1432
_ZLABEL (_LCD_W_POS, 3 );
1433
- if (!isnan (ubl.z_values [x][inverted_y ]))
1434
- lcd_put_u8str (ftostr43sign (ubl.z_values [x][inverted_y ]));
1433
+ if (!isnan (ubl.z_values [x_plot][y_plot ]))
1434
+ lcd_put_u8str (ftostr43sign (ubl.z_values [x_plot][y_plot ]));
1435
1435
else
1436
1436
lcd_put_u8str_P (PSTR (" -----" ));
1437
1437
0 commit comments