Skip to content

Commit dd3b5a1

Browse files
Misc. aesthetic adjustments
Co-Authored-By: Andrew <[email protected]>
1 parent 416f94f commit dd3b5a1

File tree

33 files changed

+13273
-13289
lines changed

33 files changed

+13273
-13289
lines changed

Marlin/src/HAL/HC32/MarlinSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

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

Marlin/src/feature/digipot/digipot_mcp4018.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#ifndef DIGIPOT_A4988_Vrefmax
3838
#define DIGIPOT_A4988_Vrefmax 1.666
3939
#endif
40-
#define DIGIPOT_MCP4018_MAX_VALUE 127
40+
#define DIGIPOT_MCP4018_MAX_VALUE 127
4141

4242
#define DIGIPOT_A4988_Itripmax(Vref) ((Vref) / (8.0 * DIGIPOT_A4988_Rsx))
4343

Marlin/src/feature/digipot/digipot_mcp4451.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
3737
#if MB(5DPRINT)
38-
#define DIGIPOT_I2C_FACTOR 117.96f
39-
#define DIGIPOT_I2C_MAX_CURRENT 1.736f
38+
#define DIGIPOT_I2C_FACTOR 117.96f
39+
#define DIGIPOT_I2C_MAX_CURRENT 1.736f
4040
#elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI)
4141
#define DIGIPOT_I2C_FACTOR 113.5f
4242
#define DIGIPOT_I2C_MAX_CURRENT 2.0f

Marlin/src/gcode/calibrate/M48.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ void GcodeSuite::M48() {
6666
return;
6767
}
6868

69-
if (verbose_level > 0)
70-
SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test");
71-
7269
const int8_t n_samples = parser.byteval('P', 10);
7370
if (!WITHIN(n_samples, 4, 50)) {
7471
SERIAL_ECHOLNPGM("?Sample size not plausible (4-50).");
@@ -102,6 +99,9 @@ void GcodeSuite::M48() {
10299
const bool schizoid_flag = parser.boolval('S');
103100
if (schizoid_flag && !seen_L) n_legs = 7;
104101

102+
if (verbose_level > 0)
103+
SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test");
104+
105105
if (verbose_level > 2)
106106
SERIAL_ECHOLNPGM("Positioning the probe...");
107107

@@ -261,8 +261,7 @@ void GcodeSuite::M48() {
261261

262262
#if HAS_STATUS_MESSAGE
263263
// Display M48 results in the status bar
264-
char sigma_str[8];
265-
ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
264+
ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6)));
266265
#endif
267266
}
268267

Marlin/src/gcode/host/M114.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@
2929
#if ENABLED(M114_DETAIL)
3030

3131
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
32-
char str[12];
3332
for (uint8_t a = 0; a < n; ++a) {
3433
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
3534
if (pos[a] >= 0) SERIAL_CHAR(' ');
36-
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
35+
SERIAL_ECHO(p_float_t(pos[a], precision));
3736
}
3837
SERIAL_EOL();
3938
}
4039
inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }
4140

4241
void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
43-
char str[12];
44-
LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
42+
LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision));
4543
SERIAL_EOL();
4644
}
4745

Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,11 @@ void MarlinUI::draw_status_message(const bool blink) {
793793
static lcd_uint_t pc = 0, pr = 2;
794794
inline void setPercentPos(const lcd_uint_t c, const lcd_uint_t r) { pc = c; pr = r; }
795795
void MarlinUI::drawPercent() {
796-
const uint8_t progress = ui.get_progress_percent();
796+
const uint8_t progress = get_progress_percent();
797797
if (progress) {
798798
lcd_moveto(pc, pr);
799799
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
800-
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
800+
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(get_progress_permyriad()), ui8tostr3rj(progress)));
801801
lcd_put_u8str(F("%"));
802802
}
803803
}
@@ -806,9 +806,9 @@ void MarlinUI::draw_status_message(const bool blink) {
806806
#if ENABLED(SHOW_REMAINING_TIME)
807807
void MarlinUI::drawRemain() {
808808
if (printJobOngoing()) {
809-
const duration_t remaint = ui.get_remaining_time();
809+
const duration_t remaint = get_remaining_time();
810810
timepos = TPOFFSET - remaint.toDigital(buffer);
811-
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
811+
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
812812
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
813813
lcd_put_u8str(buffer);
814814
}
@@ -817,10 +817,10 @@ void MarlinUI::draw_status_message(const bool blink) {
817817

818818
#if ENABLED(SHOW_INTERACTION_TIME)
819819
void MarlinUI::drawInter() {
820-
const duration_t interactt = ui.interaction_time;
820+
const duration_t interactt = interaction_time;
821821
if (printingIsActive() && interactt.value) {
822822
timepos = TPOFFSET - interactt.toDigital(buffer);
823-
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
823+
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
824824
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
825825
lcd_put_u8str(buffer);
826826
}
@@ -832,7 +832,7 @@ void MarlinUI::draw_status_message(const bool blink) {
832832
if (printJobOngoing()) {
833833
const duration_t elapsedt = print_job_timer.duration();
834834
timepos = TPOFFSET - elapsedt.toDigital(buffer);
835-
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
835+
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
836836
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
837837
lcd_put_u8str(buffer);
838838
}

Marlin/src/lcd/e3v2/common/dwin_api.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void dwinFrameAreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
234234
// *string: The string
235235
// rlimit: To limit the drawn string length
236236
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*/) {
237-
#if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, IS_DWIN_MARLINUI)
237+
#if ENABLED(DWIN_CREALITY_LCD)
238238
dwinDrawRectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
239239
#endif
240240
constexpr uint8_t widthAdjust = 0;

Marlin/src/lcd/e3v2/common/dwin_color.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
#pragma once
2323

2424
// Extended and default UI Colors
25-
#define RGB(R,G,B) (R << 11) | (G << 5) | (B) // R,B: 0..31; G: 0..63
25+
#define RGB(R,G,B) (R << 11) | (G << 5) | (B) // R: 0..31, G: 0..63, B: 0..31
2626
#define GetRColor(color) ((color >> 11) & 0x1F)
2727
#define GetGColor(color) ((color >> 5) & 0x3F)
2828
#define GetBColor(color) ((color >> 0) & 0x1F)
2929

3030
// RGB565 colors: https://rgbcolorpicker.com/565
3131
#define COLOR_WHITE 0xFFFF
32-
#define COLOR_YELLOW RGB(0x1F,0x3F,0x00)
33-
#define COLOR_RED RGB(0x1F,0x00,0x00)
32+
#define COLOR_YELLOW RGB(0x1F, 0x3F, 0x00)
33+
#define COLOR_RED RGB(0x1F, 0x00, 0x00)
3434
#define COLOR_ERROR_RED 0xB000 // Error!
3535
#define COLOR_BG_RED 0xF00F // Red background color
3636
#define COLOR_BG_WINDOW 0x31E8 // Popup background color

Marlin/src/lcd/e3v2/creality/dwin.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,12 @@ void hmiSDCardInit() { card.cdroot(); }
18161816
// Initialize or re-initialize the LCD
18171817
void MarlinUI::init_lcd() { dwinStartup(); }
18181818

1819+
void MarlinUI::update() {
1820+
eachMomentUpdate(); // Status update
1821+
hmiSDCardUpdate(); // SD card update
1822+
dwinHandleScreen(); // Rotary encoder update
1823+
}
1824+
18191825
void MarlinUI::refresh() { /* Nothing to see here */ }
18201826

18211827
#if HAS_LCD_BRIGHTNESS
@@ -4080,14 +4086,6 @@ void dwinInitScreen() {
40804086
hmiStartFrame(true);
40814087
}
40824088

4083-
void dwinUpdate() {
4084-
eachMomentUpdate(); // Status update
4085-
hmiSDCardUpdate(); // SD card update
4086-
dwinHandleScreen(); // Rotary encoder update
4087-
}
4088-
4089-
void MarlinUI::update() { dwinUpdate(); }
4090-
40914089
void eachMomentUpdate() {
40924090
static millis_t next_var_update_ms = 0, next_rts_update_ms = 0;
40934091

Marlin/src/lcd/e3v2/creality/dwin.h

-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ void hmiStep(); // Transmission ratio
244244

245245
void hmiInit();
246246
void dwinInitScreen();
247-
void dwinUpdate();
248247
void eachMomentUpdate();
249248
void dwinHandleScreen();
250249
void dwinStatusChanged(const char * const cstr=nullptr);

Marlin/src/lcd/e3v2/jyersui/dwin.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ enum colorID : uint8_t {
154154
};
155155

156156
#define Custom_Colors 10
157-
#define COLOR_AQUA RGB(0x00,0x3F,0x1F)
158157
#define COLOR_LIGHT_WHITE 0xBDD7
159-
#define COLOR_GREEN RGB(0x00,0x3F,0x00)
158+
#define COLOR_GREEN RGB(0x00, 0x3F, 0x00)
160159
#define COLOR_LIGHT_GREEN 0x3460
161160
#define COLOR_CYAN 0x07FF
162161
#define COLOR_LIGHT_CYAN 0x04F3

Marlin/src/lcd/e3v2/marlinui/ui_common.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void MarlinUI::draw_status_message(const bool blink) {
186186

187187
auto status_changed = []{
188188
static MString<>::hash_t old_hash = 0x0000;
189-
const MString<>::hash_t hash = ui.status_message.hash();
189+
const MString<>::hash_t hash = status_message.hash();
190190
const bool hash_changed = hash != old_hash;
191191
old_hash = hash;
192192
return hash_changed || !did_first_redraw;

Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void BedLevelTools::manualMove(const uint8_t mesh_x, const uint8_t mesh_y, bool
156156
}
157157
}
158158

159-
// Move / Probe methods. As examples, not yet used.
159+
// Move / Probe methods.
160160
void BedLevelTools::moveToXYZ() {
161161
goto_mesh_value = true;
162162
manualMove(mesh_x, mesh_y, false);

0 commit comments

Comments
 (0)