Skip to content

Commit

Permalink
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin
Browse files Browse the repository at this point in the history
… into MarlinFirmware-bugfix-2.0.x
  • Loading branch information
inib committed Nov 1, 2019
2 parents c07def2 + e7d9db2 commit 2b31684
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
30 changes: 30 additions & 0 deletions Marlin/src/feature/power_loss_recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
info.active_extruder = active_extruder;
#endif

#if DISABLED(NO_VOLUMETRICS)
info.volumetric_enabled = parser.volumetric_enabled;
#if EXTRUDERS > 1
for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e];
#else
if (parser.volumetric_enabled) info.filament_size = planner.filament_size[active_extruder];
#endif
#endif

#if EXTRUDERS
HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target;
#endif
Expand Down Expand Up @@ -291,6 +300,27 @@ void PrintJobRecovery::resume() {
gcode.process_subcommands_now(cmd);
#endif

// Recover volumetric extrusion state
#if DISABLED(NO_VOLUMETRICS)
#if EXTRUDERS > 1
for (int8_t e = 0; e < EXTRUDERS; e++) {
dtostrf(info.filament_size[e], 1, 3, str_1);
sprintf_P(cmd, PSTR("M200 T%i D%s"), e, str_1);
gcode.process_subcommands_now(cmd);
}
if (!info.volumetric_enabled) {
sprintf_P(cmd, PSTR("M200 T%i D0"), info.active_extruder);
gcode.process_subcommands_now(cmd);
}
#else
if (info.volumetric_enabled) {
dtostrf(info.filament_size, 1, 3, str_1);
sprintf_P(cmd, PSTR("M200 D%s"), str_1);
gcode.process_subcommands_now(cmd);
}
#endif
#endif

#if HAS_HEATED_BED
const int16_t bt = info.target_temperature_bed;
if (bt) {
Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/feature/power_loss_recovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ typedef struct {
uint8_t active_extruder;
#endif

#if DISABLED(NO_VOLUMETRICS)
bool volumetric_enabled;
#if EXTRUDERS > 1
float filament_size[EXTRUDERS];
#else
float filament_size;
#endif
#endif

#if HOTENDS
int16_t target_temperature[HOTENDS];
#endif
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ G29_TYPE GcodeSuite::G29() {
#if ABL_GRID

#if ENABLED(PROBE_MANUALLY)
ABL_VAR xy_int8_t meshCount;
ABL_VAR xy_uint8_t meshCount;
#endif

ABL_VAR xy_int_t probe_position_lf, probe_position_rb;
Expand Down Expand Up @@ -678,7 +678,7 @@ G29_TYPE GcodeSuite::G29() {

measured_z = 0;

xy_int8_t meshCount;
xy_uint8_t meshCount;

// Outer loop is X with PROBE_Y_FIRST enabled
// Outer loop is Y with PROBE_Y_FIRST disabled
Expand Down Expand Up @@ -746,7 +746,7 @@ G29_TYPE GcodeSuite::G29() {

z_values[meshCount.x][meshCount.y] = measured_z + zoffset;
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onMeshUpdate(meshCount.x, meshCount.y, z_values[meshCount.x][meshCount.y]);
ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y]);
#endif

#endif
Expand Down
9 changes: 7 additions & 2 deletions Marlin/src/gcode/feature/camera/M240.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
millis_t chdk_timeout; // = 0
#endif

#ifdef PHOTO_POSITION && PHOTO_DELAY_MS > 0
#include "../../../Marlin.h" // for idle()
#endif

#ifdef PHOTO_RETRACT_MM

#define _PHOTO_RETRACT_MM (PHOTO_RETRACT_MM + 0)
Expand Down Expand Up @@ -148,7 +152,7 @@ void GcodeSuite::M240() {
#if PIN_EXISTS(CHDK)

OUT_WRITE(CHDK_PIN, HIGH);
chdk_timeout = millis() + PHOTO_SWITCH_MS;
chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS);

#elif HAS_PHOTOGRAPH

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

#ifdef PHOTO_POSITION
#if PHOTO_DELAY_MS > 0
safe_delay(parser.intval('P', PHOTO_DELAY_MS));
const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS);
while (PENDING(millis(), timeout)) idle();
#endif
do_blocking_move_to(old_pos, fr_mm_s);
#ifdef PHOTO_RETRACT_MM
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/feature/pause/M701_M702.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "../../../Marlin.h"
#include "../../../module/motion.h"
#include "../../../module/temperature.h"
#include "../../../feature/pause.h"

#if EXTRUDERS > 1
#include "../../../module/tool_change.h"
Expand Down
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 "2019-10-29"
#define STRING_DISTRIBUTION_DATE "2019-10-31"
#endif

/**
Expand Down

0 comments on commit 2b31684

Please sign in to comment.