Skip to content

Commit

Permalink
Merge branch 'bugfix-2.0.x' into pr/24188
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 17, 2022
2 parents b665b6e + c814fe9 commit 547494a
Show file tree
Hide file tree
Showing 31 changed files with 1,631 additions and 975 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ jobs:

- name: Install PlatformIO
run: |
pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip
platformio update
pip install -U platformio
pio upgrade --dev
pio pkg update --global
- name: Run ${{ matrix.test-platform }} Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2022-05-15"
//#define STRING_DISTRIBUTION_DATE "2022-05-17"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ typedef Servo hal_servo_t;
//
// Interrupts
//
#define sei() noInterrupts()
#define cli() interrupts()
#define sei() interrupts()
#define cli() noInterrupts()

#define CRITICAL_SECTION_START() const bool _irqon = hal.isr_state(); hal.isr_off()
#define CRITICAL_SECTION_END() if (_irqon) hal.isr_on()
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp
// Echo the LCD message to serial for extra context
if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); }

#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
#if HAS_DISPLAY
ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR));
#else
UNUSED(lcd_error); UNUSED(lcd_component);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+')
#define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+')
#define COUNT(a) (sizeof(a)/sizeof(*a))
#define ZERO(a) memset(a,0,sizeof(a))
#define ZERO(a) memset((void*)a,0,sizeof(a))
#define COPY(a,b) do{ \
static_assert(sizeof(a[0]) == sizeof(b[0]), "COPY: '" STRINGIFY(a) "' and '" STRINGIFY(b) "' types (sizes) don't match!"); \
memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ void unified_bed_leveling::shift_mesh_height() {

TERN_(HAS_MARLINUI_MENU, ui.capture());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());

save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
uint8_t count = GRID_MAX_POINTS;
Expand Down Expand Up @@ -826,6 +827,7 @@ void unified_bed_leveling::shift_mesh_height() {
);

TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingDone());
}

#endif // HAS_BED_PROBE
Expand Down
26 changes: 24 additions & 2 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include "../../feature/probe_temp_comp.h"
#endif

#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/marlinui.h"
#endif

/**
* G30: Do a single Z probe at the current XY
*
Expand All @@ -48,20 +52,38 @@ void GcodeSuite::G30() {
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
parser.linearval('Y', current_position.y + probe.offset_xy.y) };

if (!probe.can_reach(pos)) return;
if (!probe.can_reach(pos)) {
#if ENABLED(DWIN_LCD_PROUI)
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
#endif
return;
}

// Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));

remember_feedrate_scaling_off();

TERN_(DWIN_LCD_PROUI, process_subcommands_now(F("G28O")));

const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;

TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
TERN_(HAS_PTC, ptc.set_enabled(true));
if (!isnan(measured_z))
if (!isnan(measured_z)) {
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
#if ENABLED(DWIN_LCD_PROUI)
char msg[31], str_1[6], str_2[6], str_3[6];
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
dtostrf(pos.x, 1, 1, str_1),
dtostrf(pos.y, 1, 1, str_2),
dtostrf(measured_z, 1, 2, str_3)
);
ui.set_status(msg);
#endif
}

restore_feedrate_and_scaling();

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/stats/M31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void GcodeSuite::M31() {
char buffer[22];
duration_t(print_job_timer.duration()).toString(buffer);

ui.set_status(buffer);
ui.set_status(buffer, ENABLED(DWIN_LCD_PROUI));

SERIAL_ECHO_MSG("Print time: ", buffer);
}
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-05-15"
#define STRING_DISTRIBUTION_DATE "2022-05-17"
#endif

/**
Expand Down
4 changes: 3 additions & 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,9 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
// *string: The string
// rlimit: To limit the drawn string length
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*/) {
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
#if DISABLED(DWIN_LCD_PROUI)
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
#endif
constexpr uint8_t widthAdjust = 0;
size_t i = 0;
DWIN_Byte(i, 0x11);
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,7 @@ void HMI_Prepare() {
EncoderRate.enabled = true;
#else
// Apply workspace offset, making the current position 0,0,0
queue.inject(F("G92 X0 Y0 Z0"));
queue.inject(F("G92X0Y0Z0"));
HMI_AudioFeedback();
#endif
break;
Expand Down Expand Up @@ -3556,9 +3556,9 @@ void HMI_AdvSet() {
case ADVSET_CASE_HOMEOFF:
checkkey = HomeOff;
select_item.reset();
HMI_ValueStruct.Home_OffX_scaled = home_offset[X_AXIS] * 10;
HMI_ValueStruct.Home_OffY_scaled = home_offset[Y_AXIS] * 10;
HMI_ValueStruct.Home_OffZ_scaled = home_offset[Z_AXIS] * 10;
HMI_ValueStruct.Home_OffX_scaled = home_offset.x * 10;
HMI_ValueStruct.Home_OffY_scaled = home_offset.y * 10;
HMI_ValueStruct.Home_OffZ_scaled = home_offset.z * 10;
Draw_HomeOff_Menu();
break;
#endif
Expand Down Expand Up @@ -3806,7 +3806,7 @@ void HMI_Tune() {
EncoderRate.enabled = true;
#else
// Apply workspace offset, making the current position 0,0,0
queue.inject(F("G92 X0 Y0 Z0"));
queue.inject(F("G92X0Y0Z0"));
HMI_AudioFeedback();
#endif
break;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
if (draw)
Draw_Menu_Item(row, ICON_SetHome, F("Set Home Position"));
else {
gcode.process_subcommands_now(F("G92 X0 Y0 Z0"));
gcode.process_subcommands_now(F("G92X0Y0Z0"));
AudioFeedback();
}
break;
Expand Down
Loading

0 comments on commit 547494a

Please sign in to comment.