Skip to content

Commit 126a4e9

Browse files
committed
Merge branch 'bugfix-2.1.x' into pr/24424
2 parents 3b0e75c + cadb1a0 commit 126a4e9

File tree

17 files changed

+59
-53
lines changed

17 files changed

+59
-53
lines changed

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2022-11-29"
44+
//#define STRING_DISTRIBUTION_DATE "2022-12-05"
4545

4646
/**
4747
* Defines a generic printer name to be output to the LCD after booting Marlin.

Marlin/src/HAL/AVR/fast_pwm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
146146
LIMIT(res_pc_temp, 1U, maxtop);
147147

148148
// Calculate frequencies of test prescaler and resolution values
149-
const int f_diff = ABS(f - int(f_desired)),
150-
f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)),
151-
f_fast_diff = ABS(f_fast_temp - int(f_desired)),
152-
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp),
153-
f_pc_diff = ABS(f_pc_temp - int(f_desired));
149+
const uint16_t f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)),
150+
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp);
151+
const int f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
152+
f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired),
153+
f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired);
154154

155155
if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f
156156
// Set the Wave Generation Mode to FAST PWM

Marlin/src/core/types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ typedef abce_float_t abce_pos_t;
309309
void toLogical(xy_pos_t &raw);
310310
void toLogical(xyz_pos_t &raw);
311311
void toLogical(xyze_pos_t &raw);
312-
void toNative(xy_pos_t &raw);
313-
void toNative(xyz_pos_t &raw);
314-
void toNative(xyze_pos_t &raw);
312+
void toNative(xy_pos_t &lpos);
313+
void toNative(xyz_pos_t &lpos);
314+
void toNative(xyze_pos_t &lpos);
315315

316316
//
317317
// Paired XY coordinates, counters, flags, etc.

Marlin/src/gcode/calibrate/M48.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void GcodeSuite::M48() {
112112
set_bed_leveling_enabled(false);
113113
#endif
114114

115-
TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
115+
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));
116116

117117
// Work with reasonable feedrates
118118
remember_feedrate_scaling_off();

Marlin/src/gcode/probe/G30.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,13 @@ void GcodeSuite::G30() {
5858
tool_change(0);
5959
#endif
6060

61-
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
62-
parser.linearval('Y', current_position.y + probe.offset_xy.y) };
61+
// Convert the given logical position to native position
62+
const xy_pos_t pos = {
63+
parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
64+
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y
65+
};
6366

64-
if (!probe.can_reach(pos)) {
65-
#if ENABLED(DWIN_LCD_PROUI)
66-
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
67-
LCD_MESSAGE(MSG_ZPROBE_OUT);
68-
#endif
69-
}
70-
else {
67+
if (probe.can_reach(pos)) {
7168
// Disable leveling so the planner won't mess with us
7269
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
7370

@@ -83,7 +80,7 @@ void GcodeSuite::G30() {
8380
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
8481
TERN_(HAS_PTC, ptc.set_enabled(true));
8582
if (!isnan(measured_z)) {
86-
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
83+
SERIAL_ECHOLNPGM("Bed X: ", pos.asLogical().x, " Y: ", pos.asLogical().y, " Z: ", measured_z);
8784
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
8885
char msg[31], str_1[6], str_2[6], str_3[6];
8986
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
@@ -102,6 +99,12 @@ void GcodeSuite::G30() {
10299

103100
report_current_position();
104101
}
102+
else {
103+
#if ENABLED(DWIN_LCD_PROUI)
104+
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
105+
LCD_MESSAGE(MSG_ZPROBE_OUT);
106+
#endif
107+
}
105108

106109
// Restore the active tool
107110
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));

Marlin/src/inc/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* version was tagged.
4343
*/
4444
#ifndef STRING_DISTRIBUTION_DATE
45-
#define STRING_DISTRIBUTION_DATE "2022-11-29"
45+
#define STRING_DISTRIBUTION_DATE "2022-12-05"
4646
#endif
4747

4848
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
234234
// *string: The string
235235
// rlimit: To limit the drawn string length
236236
void DWIN_Draw_String(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)
237+
#if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, IS_DWIN_MARLINUI)
238238
DWIN_Draw_Rectangle(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/marlinui/ui_status_480x272.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void MarlinUI::draw_status_screen() {
453453
DWIN_Draw_String(
454454
false, font16x32, Percent_Color, Color_Bg_Black,
455455
pb_left + (pb_width - dwin_string.length * 16) / 2,
456-
pb_top + (pb_height - 32) / 2,
456+
pb_top + (pb_height - 32) / 2 - 1,
457457
S(dwin_string.string())
458458
);
459459
#endif

Marlin/src/lcd/language/language_el.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace Language_el {
9595
LSTR MSG_MOVE_N = _UxGT("Μετακίνηση @");
9696
LSTR MSG_MOVE_E = _UxGT("Εξωθητής");
9797
LSTR MSG_MOVE_EN = _UxGT("Εξωθητής *");
98-
LSTR MSG_MOVE_N_MM = _UxGT("Μετακίνηση %s μμ");
98+
LSTR MSG_MOVE_N_MM = _UxGT("Μετακίνηση $μμ");
9999
LSTR MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ");
100100
LSTR MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ");
101101
LSTR MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ");

Marlin/src/lcd/language/language_el_gr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace Language_el_gr {
8484
LSTR MSG_MOVE_N = _UxGT("Μετακίνηση @");
8585
LSTR MSG_MOVE_E = _UxGT("Εξωθητήρας");
8686
LSTR MSG_MOVE_EN = _UxGT("Εξωθητήρας *");
87-
LSTR MSG_MOVE_N_MM = _UxGT("Μετακίνηση %s μμ");
87+
LSTR MSG_MOVE_N_MM = _UxGT("Μετακίνηση $μμ");
8888
LSTR MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ");
8989
LSTR MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ");
9090
LSTR MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ");

0 commit comments

Comments
 (0)