@@ -260,43 +260,38 @@ void MarlinUI::draw_status_screen() {
260
260
tft.set_background (COLOR_BACKGROUND);
261
261
tft.add_rectangle (0 , 0 , TFT_WIDTH - 8 , 34 , COLOR_AXIS_HOMED);
262
262
263
- uint16_t color;
264
- uint16_t offset;
265
- bool is_homed;
266
-
267
263
tft.add_text ( 16 , 3 , COLOR_AXIS_HOMED , " X" );
268
264
tft.add_text (192 , 3 , COLOR_AXIS_HOMED , " Y" );
269
265
tft.add_text (330 , 3 , COLOR_AXIS_HOMED , " Z" );
270
266
271
- is_homed = TEST (axis_homed, X_AXIS);
272
- tft_string.set (blink & !is_homed ? " ?" : ftostr4sign (LOGICAL_X_POSITION (current_position.x )));
273
- tft.add_text (102 - tft_string.width (), 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
267
+ bool not_homed = axis_should_home ( X_AXIS);
268
+ tft_string.set (blink && not_homed ? " ?" : ftostr4sign (LOGICAL_X_POSITION (current_position.x )));
269
+ tft.add_text (102 - tft_string.width (), 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
274
270
275
- is_homed = TEST (axis_homed, Y_AXIS);
276
- tft_string.set (blink & !is_homed ? " ?" : ftostr4sign (LOGICAL_Y_POSITION (current_position.y )));
277
- tft.add_text (280 - tft_string.width (), 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
271
+ not_homed = axis_should_home ( Y_AXIS);
272
+ tft_string.set (blink && not_homed ? " ?" : ftostr4sign (LOGICAL_Y_POSITION (current_position.y )));
273
+ tft.add_text (280 - tft_string.width (), 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
278
274
279
- is_homed = TEST (axis_homed, Z_AXIS);
280
- if (blink & !is_homed) {
275
+ uint16_t offset = 32 ;
276
+ not_homed = axis_should_home (Z_AXIS);
277
+ if (blink && not_homed)
281
278
tft_string.set (" ?" );
282
- offset = 32 ; // ".00"
283
- }
284
279
else {
285
280
const float z = LOGICAL_Z_POSITION (current_position.z );
286
281
tft_string.set (ftostr52sp ((int16_t )z));
287
282
tft_string.rtrim ();
288
- offset = tft_string.width ();
283
+ offset + = tft_string.width ();
289
284
290
285
tft_string.set (ftostr52sp (z));
291
- offset += 32 - tft_string.width ();
286
+ offset -= tft_string.width ();
292
287
}
293
- tft.add_text (455 - tft_string.width () - offset, 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
288
+ tft.add_text (455 - tft_string.width () - offset, 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
294
289
TERN_ (TOUCH_SCREEN, touch.add_control (MOVE_AXIS, 4 , 132 , TFT_WIDTH - 8 , 34 ));
295
290
296
291
// feed rate
297
292
tft.canvas (96 , 180 , 100 , 32 );
298
293
tft.set_background (COLOR_BACKGROUND);
299
- color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED;
294
+ uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED;
300
295
tft.add_image (0 , 0 , imgFeedRate, color);
301
296
tft_string.set (i16tostr3rj (feedrate_percentage));
302
297
tft_string.add (' %' );
0 commit comments