Skip to content

Commit 2b31684

Browse files
committed
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into MarlinFirmware-bugfix-2.0.x
2 parents c07def2 + e7d9db2 commit 2b31684

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed

Marlin/src/feature/power_loss_recovery.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
183183
info.active_extruder = active_extruder;
184184
#endif
185185

186+
#if DISABLED(NO_VOLUMETRICS)
187+
info.volumetric_enabled = parser.volumetric_enabled;
188+
#if EXTRUDERS > 1
189+
for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e];
190+
#else
191+
if (parser.volumetric_enabled) info.filament_size = planner.filament_size[active_extruder];
192+
#endif
193+
#endif
194+
186195
#if EXTRUDERS
187196
HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target;
188197
#endif
@@ -291,6 +300,27 @@ void PrintJobRecovery::resume() {
291300
gcode.process_subcommands_now(cmd);
292301
#endif
293302

303+
// Recover volumetric extrusion state
304+
#if DISABLED(NO_VOLUMETRICS)
305+
#if EXTRUDERS > 1
306+
for (int8_t e = 0; e < EXTRUDERS; e++) {
307+
dtostrf(info.filament_size[e], 1, 3, str_1);
308+
sprintf_P(cmd, PSTR("M200 T%i D%s"), e, str_1);
309+
gcode.process_subcommands_now(cmd);
310+
}
311+
if (!info.volumetric_enabled) {
312+
sprintf_P(cmd, PSTR("M200 T%i D0"), info.active_extruder);
313+
gcode.process_subcommands_now(cmd);
314+
}
315+
#else
316+
if (info.volumetric_enabled) {
317+
dtostrf(info.filament_size, 1, 3, str_1);
318+
sprintf_P(cmd, PSTR("M200 D%s"), str_1);
319+
gcode.process_subcommands_now(cmd);
320+
}
321+
#endif
322+
#endif
323+
294324
#if HAS_HEATED_BED
295325
const int16_t bt = info.target_temperature_bed;
296326
if (bt) {

Marlin/src/feature/power_loss_recovery.h

+9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ typedef struct {
5959
uint8_t active_extruder;
6060
#endif
6161

62+
#if DISABLED(NO_VOLUMETRICS)
63+
bool volumetric_enabled;
64+
#if EXTRUDERS > 1
65+
float filament_size[EXTRUDERS];
66+
#else
67+
float filament_size;
68+
#endif
69+
#endif
70+
6271
#if HOTENDS
6372
int16_t target_temperature[HOTENDS];
6473
#endif

Marlin/src/gcode/bedlevel/abl/G29.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ G29_TYPE GcodeSuite::G29() {
225225
#if ABL_GRID
226226

227227
#if ENABLED(PROBE_MANUALLY)
228-
ABL_VAR xy_int8_t meshCount;
228+
ABL_VAR xy_uint8_t meshCount;
229229
#endif
230230

231231
ABL_VAR xy_int_t probe_position_lf, probe_position_rb;
@@ -678,7 +678,7 @@ G29_TYPE GcodeSuite::G29() {
678678

679679
measured_z = 0;
680680

681-
xy_int8_t meshCount;
681+
xy_uint8_t meshCount;
682682

683683
// Outer loop is X with PROBE_Y_FIRST enabled
684684
// Outer loop is Y with PROBE_Y_FIRST disabled
@@ -746,7 +746,7 @@ G29_TYPE GcodeSuite::G29() {
746746

747747
z_values[meshCount.x][meshCount.y] = measured_z + zoffset;
748748
#if ENABLED(EXTENSIBLE_UI)
749-
ExtUI::onMeshUpdate(meshCount.x, meshCount.y, z_values[meshCount.x][meshCount.y]);
749+
ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y]);
750750
#endif
751751

752752
#endif

Marlin/src/gcode/feature/camera/M240.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
millis_t chdk_timeout; // = 0
3232
#endif
3333

34+
#ifdef PHOTO_POSITION && PHOTO_DELAY_MS > 0
35+
#include "../../../Marlin.h" // for idle()
36+
#endif
37+
3438
#ifdef PHOTO_RETRACT_MM
3539

3640
#define _PHOTO_RETRACT_MM (PHOTO_RETRACT_MM + 0)
@@ -148,7 +152,7 @@ void GcodeSuite::M240() {
148152
#if PIN_EXISTS(CHDK)
149153

150154
OUT_WRITE(CHDK_PIN, HIGH);
151-
chdk_timeout = millis() + PHOTO_SWITCH_MS;
155+
chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS);
152156

153157
#elif HAS_PHOTOGRAPH
154158

@@ -160,7 +164,8 @@ void GcodeSuite::M240() {
160164

161165
#ifdef PHOTO_POSITION
162166
#if PHOTO_DELAY_MS > 0
163-
safe_delay(parser.intval('P', PHOTO_DELAY_MS));
167+
const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS);
168+
while (PENDING(millis(), timeout)) idle();
164169
#endif
165170
do_blocking_move_to(old_pos, fr_mm_s);
166171
#ifdef PHOTO_RETRACT_MM

Marlin/src/gcode/feature/pause/M701_M702.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "../../../Marlin.h"
2929
#include "../../../module/motion.h"
3030
#include "../../../module/temperature.h"
31+
#include "../../../feature/pause.h"
3132

3233
#if EXTRUDERS > 1
3334
#include "../../../module/tool_change.h"

Marlin/src/inc/Version.h

+1-1
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 "2019-10-29"
45+
#define STRING_DISTRIBUTION_DATE "2019-10-31"
4646
#endif
4747

4848
/**

0 commit comments

Comments
 (0)