From 056dd71494364841363b2643597ea7382dac8a5c Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Tue, 6 Jun 2023 19:06:50 +0200 Subject: [PATCH] Substitute LCD_SERIAL.println() with LCD_SERIAL.print(,2) to ensure display compatibility. --- .../extui/knutwurst/anycubic_touchscreen.cpp | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp index 1c55803c..1cd1ee5a 100755 --- a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp +++ b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp @@ -1546,11 +1546,14 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) { } else if (CodeSeen('G')) { // Get current offset - SENDLINE_PGM("A31V "); - if (isPrinting()) - LCD_SERIAL.println(live_Zoffset); - else { - LCD_SERIAL.println(getZOffset_mm()); + if (isPrinting()) { + SEND_PGM("A31V "); + LCD_SERIAL.print(live_Zoffset, 2); + SENDLINE_PGM(""); + } else { + SEND_PGM("A31V "); + LCD_SERIAL.print(getZOffset_mm(), 2); + SENDLINE_PGM(""); selectedmeshpoint.x = selectedmeshpoint.y = 99; } } @@ -1575,8 +1578,10 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) { babystepAxis_steps(steps, Z); live_Zoffset += Zshift; } - SENDLINE_PGM("A31V "); - LCD_SERIAL.println(live_Zoffset); + + SEND_PGM("A31V "); + LCD_SERIAL.print(live_Zoffset, 2); + SENDLINE_PGM(""); } else { GRID_LOOP(x, y) { @@ -1593,8 +1598,10 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) { #endif setZOffset_mm(currZOffset + Zshift); - SENDLINE_PGM("A31V "); - LCD_SERIAL.println(getZOffset_mm()); + + SEND_PGM("A31V "); + LCD_SERIAL.print(getZOffset_mm(), 2); + SENDLINE_PGM(""); if (isAxisPositionKnown(Z)) { const float currZpos = getAxisPosition_mm(Z);