From 44edffa0a95d3d3612792eaaab7c921585daa831 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Sep 2017 01:43:06 -0500 Subject: [PATCH 1/4] Fix SLOW_PWM_HEATERS, issues already patched in 2.0.x --- Marlin/Marlin_main.cpp | 3 +-- Marlin/SdBaseFile.cpp | 2 +- Marlin/temperature.cpp | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 137d03e67..515f55f05 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10965,7 +10965,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder const float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - float z_raise = 0; + float z_raise = PARKING_EXTRUDER_SECURITY_RAISE; if (!no_move) { const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, @@ -10988,7 +10988,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n SERIAL_ECHOLNPGM("Starting Autopark"); if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); #endif - z_raise = PARKING_EXTRUDER_SECURITY_RAISE; current_position[Z_AXIS] += z_raise; #if ENABLED(DEBUG_LEVELING_FEATURE) SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp index 0511994e2..241f07b0f 100644 --- a/Marlin/SdBaseFile.cpp +++ b/Marlin/SdBaseFile.cpp @@ -1384,7 +1384,7 @@ bool SdBaseFile::rmdir() { * the value zero, false, is returned for failure. */ bool SdBaseFile::rmRfStar() { - uint16_t index; + uint32_t index; SdBaseFile f; rewind(); while (curPosition_ < fileSize_) { diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index d24512a43..fc4b63738 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1813,8 +1813,8 @@ void Temperature::isr() { // Macros for Slow PWM timer logic #define _SLOW_PWM_ROUTINE(NR, src) \ - soft_pwm_ ##NR = src; \ - if (soft_pwm_ ##NR > 0) { \ + soft_pwm_count_ ##NR = src; \ + if (soft_pwm_count_ ##NR > 0) { \ if (state_timer_heater_ ##NR == 0) { \ if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \ state_heater_ ##NR = 1; \ @@ -1831,7 +1831,7 @@ void Temperature::isr() { #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n]) #define PWM_OFF_ROUTINE(NR) \ - if (soft_pwm_ ##NR < slow_pwm_count) { \ + if (soft_pwm_count_ ##NR < slow_pwm_count) { \ if (state_timer_heater_ ##NR == 0) { \ if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \ state_heater_ ##NR = 0; \ From 30e4b855877f5496b48e581867a551cc7f3ac2f2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Sep 2017 16:51:06 -0500 Subject: [PATCH 2/4] Fix M118 parameters, with strict guideline --- Marlin/Marlin_main.cpp | 4 ++-- Marlin/gcode.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 515f55f05..879dfb83c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8705,8 +8705,8 @@ inline void gcode_M117() { lcd_setstatus(parser.string_arg); } /** * M118: Display a message in the host console. * - * A Append '// ' for an action command, as in OctoPrint - * E Have the host 'echo:' the text + * A1 Append '// ' for an action command, as in OctoPrint + * E1 Have the host 'echo:' the text */ inline void gcode_M118() { if (parser.boolval('E')) SERIAL_ECHO_START(); diff --git a/Marlin/gcode.cpp b/Marlin/gcode.cpp index f7516eb69..34ff60f63 100644 --- a/Marlin/gcode.cpp +++ b/Marlin/gcode.cpp @@ -150,7 +150,7 @@ void GCodeParser::parse(char *p) { #endif // Only use string_arg for these M codes - if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; } + if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 928: string_arg = p; return; default: break; } #if ENABLED(DEBUG_GCODE_PARSER) const bool debug = codenum == 800; @@ -162,6 +162,7 @@ void GCodeParser::parse(char *p) { * Most codes ignore 'string_arg', but those that want a string will get the right pointer. * The following loop assigns the first "parameter" having no numeric value to 'string_arg'. * This allows M0/M1 with expire time to work: "M0 S5 You Win!" + * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' */ string_arg = NULL; while (char code = *p++) { // Get the next parameter. A NUL ends the loop From 26ebeadfaa86d3f21ce0bd33fc01747359f3369a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Nov 2017 17:16:15 -0600 Subject: [PATCH 3/4] Eliminate some compiler warnings --- Marlin/Marlin_main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 879dfb83c..18d10ac39 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5055,6 +5055,8 @@ void home_all_axes() { gcode_G28(true); } bool zig = PR_OUTER_END & 1; // Always end at RIGHT and BACK_PROBE_BED_POSITION + measured_z = 0; + // Outer loop is Y with PROBE_Y_FIRST disabled for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { @@ -13025,6 +13027,7 @@ void prepare_move_to_destination() { #if ENABLED(CNC_WORKSPACE_PLANES) AxisEnum p_axis, q_axis, l_axis; switch (workspace_plane) { + default: case PLANE_XY: p_axis = X_AXIS; q_axis = Y_AXIS; l_axis = Z_AXIS; break; case PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; case PLANE_YZ: p_axis = Y_AXIS; q_axis = Z_AXIS; l_axis = X_AXIS; break; From e1ab285435974e00901babd23a86ea0c9f5aaf3e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2017 19:26:06 -0500 Subject: [PATCH 4/4] Fix some section sizes in EEPROM head comment --- Marlin/configuration_store.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index a245c6d41..5faacc15e 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -64,7 +64,7 @@ * 195 M206 XYZ home_offset (float x3) * 207 M218 XYZ hotend_offset (float x3 per additional hotend) * - * Global Leveling: + * Global Leveling: 4 bytes * 219 z_fade_height (float) * * MESH_BED_LEVELING: 43 bytes @@ -80,7 +80,7 @@ * ABL_PLANAR: 36 bytes * 270 planner.bed_level_matrix (matrix_3x3 = float x9) * - * AUTO_BED_LEVELING_BILINEAR: 47 bytes + * AUTO_BED_LEVELING_BILINEAR: 46 bytes * 306 GRID_MAX_POINTS_X (uint8_t) * 307 GRID_MAX_POINTS_Y (uint8_t) * 308 bilinear_grid_spacing (int x2)