From 72a9fed4fb392319b5a34bfb36857538443c4103 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 18 Mar 2015 11:41:14 +0100 Subject: [PATCH 1/3] codepos not used in gcode_M28() Got: Marlin_main.cpp:2567: warning: unused variable 'codepos' Needs revision. Don't now how this should look like. --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5ad45ef2e..e5e548c52 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2564,7 +2564,7 @@ inline void gcode_M17() { * M28: Start SD Write */ inline void gcode_M28() { - char* codepos = strchr_pointer + 4; +// char* codepos = strchr_pointer + 4; // ??? not used ??? char* starpos = strchr(strchr_pointer + 4, '*'); if (starpos) { char* npos = strchr(cmdbuffer[bufindr], 'N'); From ae01a6b5f2c7236ee8b6ba4b2b14c33e3e17fddb Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 19 Mar 2015 09:45:16 +0100 Subject: [PATCH 2/3] Make use of codepos. Saves one addition. Needs one pointer on the stack. Don't know if this is a go trade. --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e5e548c52..5527cebb6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2564,14 +2564,14 @@ inline void gcode_M17() { * M28: Start SD Write */ inline void gcode_M28() { -// char* codepos = strchr_pointer + 4; // ??? not used ??? - char* starpos = strchr(strchr_pointer + 4, '*'); + char* codepos = strchr_pointer + 4; + char* starpos = strchr(codepos, '*'); if (starpos) { char* npos = strchr(cmdbuffer[bufindr], 'N'); strchr_pointer = strchr(npos, ' ') + 1; *(starpos) = '\0'; } - card.openFile(strchr_pointer + 4, false); + card.openFile(codepos, false); } /** From fa889cd6e142167e24c45656400397b4251ad0ee Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 19 Mar 2015 22:13:37 +0100 Subject: [PATCH 3/3] Beautivy statusscreen by shifting things some pixels around --- Marlin/dogm_lcd_implementation.h | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b60d68936..aecec0109 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -197,7 +197,7 @@ static void lcd_implementation_status_screen() { u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2); } - u8g.setPrintPos(80,47); + u8g.setPrintPos(80,48); if (starttime != 0) { uint16_t time = (millis() - starttime) / 60000; u8g.print(itostr2(time/60)); @@ -231,26 +231,27 @@ static void lcd_implementation_status_screen() { } // X, Y, Z-Coordinates + #define XYZ_BASELINE 38 u8g.setFont(FONT_STATUSMENU); - u8g.drawBox(0,29,128,10); + u8g.drawBox(0,30,128,9); u8g.setColorIndex(0); // white on black - u8g.setPrintPos(2,37); + u8g.setPrintPos(2,XYZ_BASELINE); u8g.print("X"); - u8g.drawPixel(8,33); - u8g.drawPixel(8,35); - u8g.setPrintPos(10,37); + u8g.drawPixel(8,XYZ_BASELINE - 5); + u8g.drawPixel(8,XYZ_BASELINE - 3); + u8g.setPrintPos(10,XYZ_BASELINE); u8g.print(ftostr31ns(current_position[X_AXIS])); - u8g.setPrintPos(43,37); + u8g.setPrintPos(43,XYZ_BASELINE); lcd_printPGM(PSTR("Y")); - u8g.drawPixel(49,33); - u8g.drawPixel(49,35); - u8g.setPrintPos(51,37); + u8g.drawPixel(49,XYZ_BASELINE - 5); + u8g.drawPixel(49,XYZ_BASELINE - 3); + u8g.setPrintPos(51,XYZ_BASELINE); u8g.print(ftostr31ns(current_position[Y_AXIS])); - u8g.setPrintPos(83,37); + u8g.setPrintPos(83,XYZ_BASELINE); u8g.print("Z"); - u8g.drawPixel(89,33); - u8g.drawPixel(89,35); - u8g.setPrintPos(91,37); + u8g.drawPixel(89,XYZ_BASELINE - 5); + u8g.drawPixel(89,XYZ_BASELINE - 3); + u8g.setPrintPos(91,XYZ_BASELINE); u8g.print(ftostr31(current_position[Z_AXIS])); u8g.setColorIndex(1); // black on white @@ -259,13 +260,13 @@ static void lcd_implementation_status_screen() { u8g.setPrintPos(3,49); u8g.print(LCD_STR_FEEDRATE[0]); u8g.setFont(FONT_STATUSMENU); - u8g.setPrintPos(12,48); + u8g.setPrintPos(12,49); u8g.print(itostr3(feedmultiply)); u8g.print('%'); // Status line u8g.setFont(FONT_STATUSMENU); - u8g.setPrintPos(0,61); + u8g.setPrintPos(0,63); #ifndef FILAMENT_LCD_DISPLAY u8g.print(lcd_status_message); #else