Skip to content

Commit

Permalink
Misc. aesthetic adjustments
Browse files Browse the repository at this point in the history
Co-Authored-By: Andrew <18502096+classicrocker883@users.noreply.github.com>
  • Loading branch information
thinkyhead and classicrocker883 committed Jan 22, 2024
1 parent 416f94f commit dd3b5a1
Show file tree
Hide file tree
Showing 33 changed files with 13,273 additions and 13,289 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HC32/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/digipot/digipot_mcp4018.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/digipot/digipot_mcp4451.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).");
Expand Down Expand Up @@ -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...");

Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/gcode/host/M114.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("%"));
}
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/common/dwin_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/e3v2/common/dwin_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion Marlin/src/lcd/e3v2/creality/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/e3v2/jyersui/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ enum colorID : uint8_t {
};

#define Custom_Colors 10
#define COLOR_AQUA RGB(0x00,0x3F,0x1F)
#define COLOR_LIGHT_WHITE 0xBDD7
#define COLOR_GREEN RGB(0x00,0x3F,0x00)
#define COLOR_GREEN RGB(0x00, 0x3F, 0x00)
#define COLOR_LIGHT_GREEN 0x3460
#define COLOR_CYAN 0x07FF
#define COLOR_LIGHT_CYAN 0x04F3
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void MarlinUI::draw_status_message(const bool blink) {

auto status_changed = []{
static MString<>::hash_t old_hash = 0x0000;
const MString<>::hash_t hash = ui.status_message.hash();
const MString<>::hash_t hash = status_message.hash();
const bool hash_changed = hash != old_hash;
old_hash = hash;
return hash_changed || !did_first_redraw;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void BedLevelTools::manualMove(const uint8_t mesh_x, const uint8_t mesh_y, bool
}
}

// Move / Probe methods. As examples, not yet used.
// Move / Probe methods.
void BedLevelTools::moveToXYZ() {
goto_mesh_value = true;
manualMove(mesh_x, mesh_y, false);
Expand Down
Loading

0 comments on commit dd3b5a1

Please sign in to comment.