Browse Source

Misc. aesthetic adjustments

Co-Authored-By: Andrew <18502096+classicrocker883@users.noreply.github.com>
Scott Lahteine 1 year ago
parent
commit
dd3b5a10a0

+ 1 - 1
Marlin/src/HAL/HC32/MarlinSerial.cpp

@@ -27,7 +27,7 @@
 
 /**
  * Not every MarlinSerial instance should handle emergency parsing, as
- * it would not make sense to parse GCode from TMC responses
+ * it would not make sense to parse G-Code from TMC responses
  */
 constexpr bool serial_handles_emergency(int port) {
   return false

+ 1 - 1
Marlin/src/feature/digipot/digipot_mcp4018.cpp

@@ -37,7 +37,7 @@
 #ifndef DIGIPOT_A4988_Vrefmax
   #define DIGIPOT_A4988_Vrefmax         1.666
 #endif
-#define DIGIPOT_MCP4018_MAX_VALUE       127
+#define DIGIPOT_MCP4018_MAX_VALUE     127
 
 #define DIGIPOT_A4988_Itripmax(Vref)    ((Vref) / (8.0 * DIGIPOT_A4988_Rsx))
 

+ 2 - 2
Marlin/src/feature/digipot/digipot_mcp4451.cpp

@@ -35,8 +35,8 @@
 
 // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
 #if MB(5DPRINT)
-  #define DIGIPOT_I2C_FACTOR      117.96f
-  #define DIGIPOT_I2C_MAX_CURRENT   1.736f
+  #define DIGIPOT_I2C_FACTOR     117.96f
+  #define DIGIPOT_I2C_MAX_CURRENT 1.736f
 #elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI)
   #define DIGIPOT_I2C_FACTOR      113.5f
   #define DIGIPOT_I2C_MAX_CURRENT   2.0f

+ 4 - 5
Marlin/src/gcode/calibrate/M48.cpp

@@ -66,9 +66,6 @@ void GcodeSuite::M48() {
     return;
   }
 
-  if (verbose_level > 0)
-    SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test");
-
   const int8_t n_samples = parser.byteval('P', 10);
   if (!WITHIN(n_samples, 4, 50)) {
     SERIAL_ECHOLNPGM("?Sample size not plausible (4-50).");
@@ -102,6 +99,9 @@ void GcodeSuite::M48() {
   const bool schizoid_flag = parser.boolval('S');
   if (schizoid_flag && !seen_L) n_legs = 7;
 
+  if (verbose_level > 0)
+    SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test");
+
   if (verbose_level > 2)
     SERIAL_ECHOLNPGM("Positioning the probe...");
 
@@ -261,8 +261,7 @@ void GcodeSuite::M48() {
 
     #if HAS_STATUS_MESSAGE
       // Display M48 results in the status bar
-      char sigma_str[8];
-      ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
+      ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6)));
     #endif
   }
 

+ 2 - 4
Marlin/src/gcode/host/M114.cpp

@@ -29,19 +29,17 @@
 #if ENABLED(M114_DETAIL)
 
   void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
-    char str[12];
     for (uint8_t a = 0; a < n; ++a) {
       SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
       if (pos[a] >= 0) SERIAL_CHAR(' ');
-      SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
+      SERIAL_ECHO(p_float_t(pos[a], precision));
     }
     SERIAL_EOL();
   }
   inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }
 
   void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
-    char str[12];
-    LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
+    LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision));
     SERIAL_EOL();
   }
 

+ 7 - 7
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

@@ -793,11 +793,11 @@ void MarlinUI::draw_status_message(const bool blink) {
     static lcd_uint_t pc = 0, pr = 2;
     inline void setPercentPos(const lcd_uint_t c, const lcd_uint_t r) { pc = c; pr = r; }
     void MarlinUI::drawPercent() {
-      const uint8_t progress = ui.get_progress_percent();
+      const uint8_t progress = get_progress_percent();
       if (progress) {
         lcd_moveto(pc, pr);
         lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
-        lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
+        lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(get_progress_permyriad()), ui8tostr3rj(progress)));
         lcd_put_u8str(F("%"));
       }
     }
@@ -806,9 +806,9 @@ void MarlinUI::draw_status_message(const bool blink) {
   #if ENABLED(SHOW_REMAINING_TIME)
     void MarlinUI::drawRemain() {
       if (printJobOngoing()) {
-        const duration_t remaint = ui.get_remaining_time();
+        const duration_t remaint = get_remaining_time();
         timepos = TPOFFSET - remaint.toDigital(buffer);
-        TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
+        IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
         lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
         lcd_put_u8str(buffer);
       }
@@ -817,10 +817,10 @@ void MarlinUI::draw_status_message(const bool blink) {
 
   #if ENABLED(SHOW_INTERACTION_TIME)
     void MarlinUI::drawInter() {
-      const duration_t interactt = ui.interaction_time;
+      const duration_t interactt = interaction_time;
       if (printingIsActive() && interactt.value) {
         timepos = TPOFFSET - interactt.toDigital(buffer);
-        TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
+        IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
         lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
         lcd_put_u8str(buffer);
       }
@@ -832,7 +832,7 @@ void MarlinUI::draw_status_message(const bool blink) {
       if (printJobOngoing()) {
         const duration_t elapsedt = print_job_timer.duration();
         timepos = TPOFFSET - elapsedt.toDigital(buffer);
-        TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
+        IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
         lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
         lcd_put_u8str(buffer);
       }

+ 1 - 1
Marlin/src/lcd/e3v2/common/dwin_api.cpp

@@ -234,7 +234,7 @@ void dwinFrameAreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
 //  *string: The string
 //  rlimit: To limit the drawn string length
 void dwinDrawString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) {
-  #if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, IS_DWIN_MARLINUI)
+  #if ENABLED(DWIN_CREALITY_LCD)
     dwinDrawRectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
   #endif
   constexpr uint8_t widthAdjust = 0;

+ 3 - 3
Marlin/src/lcd/e3v2/common/dwin_color.h

@@ -22,15 +22,15 @@
 #pragma once
 
 // Extended and default UI Colors
-#define RGB(R,G,B)  (R << 11) | (G << 5) | (B) // R,B: 0..31; G: 0..63
+#define RGB(R,G,B)  (R << 11) | (G << 5) | (B) // R: 0..31, G: 0..63, B: 0..31
 #define GetRColor(color) ((color >> 11) & 0x1F)
 #define GetGColor(color) ((color >>  5) & 0x3F)
 #define GetBColor(color) ((color >>  0) & 0x1F)
 
 // RGB565 colors: https://rgbcolorpicker.com/565
 #define COLOR_WHITE         0xFFFF
-#define COLOR_YELLOW        RGB(0x1F,0x3F,0x00)
-#define COLOR_RED           RGB(0x1F,0x00,0x00)
+#define COLOR_YELLOW        RGB(0x1F, 0x3F, 0x00)
+#define COLOR_RED           RGB(0x1F, 0x00, 0x00)
 #define COLOR_ERROR_RED     0xB000  // Error!
 #define COLOR_BG_RED        0xF00F  // Red background color
 #define COLOR_BG_WINDOW     0x31E8  // Popup background color

+ 6 - 8
Marlin/src/lcd/e3v2/creality/dwin.cpp

@@ -1816,6 +1816,12 @@ void hmiSDCardInit() { card.cdroot(); }
 // Initialize or re-initialize the LCD
 void MarlinUI::init_lcd() { dwinStartup(); }
 
+void MarlinUI::update() {
+  eachMomentUpdate(); // Status update
+  hmiSDCardUpdate();  // SD card update
+  dwinHandleScreen(); // Rotary encoder update
+}
+
 void MarlinUI::refresh() { /* Nothing to see here */ }
 
 #if HAS_LCD_BRIGHTNESS
@@ -4080,14 +4086,6 @@ void dwinInitScreen() {
   hmiStartFrame(true);
 }
 
-void dwinUpdate() {
-  eachMomentUpdate(); // Status update
-  hmiSDCardUpdate();  // SD card update
-  dwinHandleScreen(); // Rotary encoder update
-}
-
-void MarlinUI::update() { dwinUpdate(); }
-
 void eachMomentUpdate() {
   static millis_t next_var_update_ms = 0, next_rts_update_ms = 0;
 

+ 0 - 1
Marlin/src/lcd/e3v2/creality/dwin.h

@@ -244,7 +244,6 @@ void hmiStep();            // Transmission ratio
 
 void hmiInit();
 void dwinInitScreen();
-void dwinUpdate();
 void eachMomentUpdate();
 void dwinHandleScreen();
 void dwinStatusChanged(const char * const cstr=nullptr);

Some files were not shown because too many files changed in this diff