Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxies-CSTL committed Dec 18, 2021
2 parents b224f90 + b16b1d1 commit 32b1ef7
Show file tree
Hide file tree
Showing 43 changed files with 546 additions and 185 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# Generated files
_Version.h
bdf2u8g
marlin_config.json
mczip.h
*.gen

#
# OS
Expand Down
8 changes: 8 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,14 @@
#define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
#endif

/**
* Enable this option if you have more than ~3K of unused flash space.
* Marlin will embed all settings in the firmware binary as compressed data.
* Use 'M503 C' to write the settings out to the SD Card as 'mc.zip'.
* See docs/ConfigEmbedding.md for details on how to use 'mc-apply.py'.
*/
//#define CONFIGURATION_EMBEDDING

// Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER

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 "2021-12-12"
//#define STRING_DISTRIBUTION_DATE "2021-12-18"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,10 @@ void idle(bool no_stepper_sleep/*=false*/) {
(void)check_tool_sensor_stats(active_extruder, true);

// Handle filament runout sensors
TERN_(HAS_FILAMENT_SENSOR, runout.run());
#if HAS_FILAMENT_SENSOR
if (TERN1(HAS_PRUSA_MMU2, !mmu2.enabled()))
runout.run();
#endif

// Run HAL idle tasks
TERN_(HAL_IDLETASK, HAL_idletask());
Expand Down
15 changes: 4 additions & 11 deletions Marlin/src/feature/pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,10 @@ extern fil_change_settings_t fc_settings[EXTRUDERS];

extern uint8_t did_pause_print;

#if ENABLED(DUAL_X_CARRIAGE)
#define DXC_PARAMS , const int8_t DXC_ext=-1
#define DXC_ARGS , const int8_t DXC_ext
#define DXC_PASS , DXC_ext
#define DXC_SAY , " dxc:", int(DXC_ext)
#else
#define DXC_PARAMS
#define DXC_ARGS
#define DXC_PASS
#define DXC_SAY
#endif
#define DXC_PARAMS OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext=-1)
#define DXC_ARGS OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext)
#define DXC_PASS OPTARG(DUAL_X_CARRIAGE, DXC_ext)
#define DXC_SAY OPTARG(DUAL_X_CARRIAGE, " dxc:", int(DXC_ext))

// Pause the print. If unload_length is set, do a Filament Unload
bool pause_print(
Expand Down
18 changes: 18 additions & 0 deletions Marlin/src/gcode/eeprom/M500-M504.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#include "../../core/serial.h"
#include "../../inc/MarlinConfig.h"

#if ENABLED(CONFIGURATION_EMBEDDING)
#include "../../sd/SdBaseFile.h"
#include "../../mczip.h"
#endif

/**
* M500: Store settings in EEPROM
*/
Expand All @@ -50,9 +55,22 @@ void GcodeSuite::M502() {

/**
* M503: print settings currently in memory
*
* With CONFIGURATION_EMBEDDING:
* C<flag> : Save the full Marlin configuration to SD Card as "mc.zip"
*/
void GcodeSuite::M503() {
(void)settings.report(!parser.boolval('S', true));

#if ENABLED(CONFIGURATION_EMBEDDING)
if (parser.seen_test('C')) {
SdBaseFile file;
const uint16_t size = sizeof(mc_zip);
// Need to create the config size on the SD card
if (file.open("mc.zip", O_WRITE|O_CREAT) && file.write(pgm_read_ptr(mc_zip), size) != -1 && file.close())
SERIAL_ECHO_MSG("Configuration saved as 'mc.zip'");
}
#endif
}

#endif // !DISABLE_M503
Expand Down
45 changes: 26 additions & 19 deletions Marlin/src/gcode/feature/pause/M600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
#include "../../../module/tool_change.h"
#endif

#if ENABLED(MMU2_MENUS)
#include "../../../lcd/menu/menu_mmu2.h"
#if ENABLED(HAS_PRUSA_MMU2)
#include "../../../feature/mmu/mmu2.h"
#if ENABLED(MMU2_MENUS)
#include "../../../lcd/menu/menu_mmu2.h"
#endif
#endif

#if ENABLED(MIXING_EXTRUDER)
Expand Down Expand Up @@ -92,10 +95,11 @@ void GcodeSuite::M600() {
}
#endif

const bool standardM600 = TERN1(MMU2_MENUS, !mmu2.enabled());

// Show initial "wait for start" message
#if DISABLED(MMU2_MENUS)
if (standardM600)
ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
#endif

#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
// If needed, home before parking for filament change
Expand Down Expand Up @@ -126,17 +130,11 @@ void GcodeSuite::M600() {
#endif

#if ENABLED(MMU2_MENUS)
// For MMU2 reset retract and load/unload values so they don't mess with MMU filament handling
constexpr float unload_length = 0.5f,
slow_load_length = 0.0f,
fast_load_length = 0.0f;
// For MMU2, when enabled, reset retract value so it doesn't mess with MMU filament handling
const float unload_length = standardM600 ? -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length)) : 0.5f;
#else
// Unload filament
const float unload_length = -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length));
// Slow load filament
constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
// Fast load filament
const float fast_load_length = ABS(parser.axisunitsval('L', E_AXIS, fc_settings[active_extruder].load_length));
#endif

const int beep_count = parser.intval('B', -1
Expand All @@ -146,14 +144,23 @@ void GcodeSuite::M600() {
);

if (pause_print(retract, park_point, true, unload_length DXC_PASS)) {
#if ENABLED(MMU2_MENUS)
mmu2_M600();
resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS);
#else
if (standardM600) {
wait_for_confirmation(true, beep_count DXC_PASS);
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH,
beep_count, (parser.seenval('R') ? parser.value_celsius() : 0) DXC_PASS);
#endif
resume_print(
FILAMENT_CHANGE_SLOW_LOAD_LENGTH,
ABS(parser.axisunitsval('L', E_AXIS, fc_settings[active_extruder].load_length)),
ADVANCED_PAUSE_PURGE_LENGTH,
beep_count,
parser.celsiusval('R')
DXC_PASS
);
}
else {
#if ENABLED(MMU2_MENUS)
mmu2_M600();
resume_print(0, 0, 0, beep_count, 0 DXC_PASS);
#endif
}
}

#if HAS_MULTI_EXTRUDER
Expand Down
31 changes: 24 additions & 7 deletions Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "../../inc/MarlinConfig.h"
#include "../queue.h" // for getting the command port


#if ENABLED(M115_GEOMETRY_REPORT)
#include "../../module/motion.h"
#endif
Expand All @@ -33,13 +32,25 @@
#include "../../feature/caselight.h"
#endif

//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities

#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
static void cap_line(FSTR_P const name, bool ena=false) {
SERIAL_ECHOPGM("Cap:");
SERIAL_ECHOF(name);
SERIAL_CHAR(':', '0' + ena);
SERIAL_EOL();
}
#if ENABLED(MINIMAL_CAP_LINES)
#define cap_line(S,C) if (C) _cap_line(S)
static void _cap_line(FSTR_P const name) {
SERIAL_ECHOPGM("Cap:");
SERIAL_ECHOF(name);
SERIAL_ECHOLNPGM(":1");
}
#else
#define cap_line(V...) _cap_line(V)
static void _cap_line(FSTR_P const name, bool ena=false) {
SERIAL_ECHOPGM("Cap:");
SERIAL_ECHOF(name);
SERIAL_CHAR(':', '0' + ena);
SERIAL_EOL();
}
#endif
#endif

/**
Expand Down Expand Up @@ -143,6 +154,9 @@ void GcodeSuite::M115() {
// LONG_FILENAME_HOST_SUPPORT (M33)
cap_line(F("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));

// EXTENDED_M20 (M20 L)
cap_line(F("EXTENDED_M20"), ENABLED(LONG_FILENAME_HOST_SUPPORT));

// THERMAL_PROTECTION
cap_line(F("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));

Expand All @@ -164,6 +178,9 @@ void GcodeSuite::M115() {
// MEATPACK Compression
cap_line(F("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack));

// CONFIG_EXPORT
cap_line(F("CONFIG_EXPORT"), ENABLED(CONFIG_EMBED_AND_SAVE_TO_SD));

// Machine Geometry
#if ENABLED(M115_GEOMETRY_REPORT)
const xyz_pos_t bmin = { 0, 0, 0 },
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/gcode/sd/M21_M22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "../gcode.h"
#include "../../sd/cardreader.h"
#include "../../lcd/marlinui.h"

/**
* M21: Init SD Card
Expand All @@ -38,7 +37,6 @@ void GcodeSuite::M21() { card.mount(); }
*/
void GcodeSuite::M22() {
if (!IS_SD_PRINTING()) card.release();
IF_ENABLED(TFT_COLOR_UI, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
}

#endif // SDSUPPORT
6 changes: 6 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1004,3 +1004,9 @@
#if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2)
#define HAS_MEATPACK 1
#endif

// AVR are (usually) too limited in resources to store the configuration into the binary
#if !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || DISABLED(SDSUPPORT) || EITHER(SDCARD_READONLY, DISABLE_M503))
#undef CONFIGURATION_EMBEDDING
#define CANNOT_EMBED_CONFIGURATION defined(__AVR__)
#endif
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 "2021-12-12"
#define STRING_DISTRIBUTION_DATE "2021-12-18"
#endif

/**
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,7 @@
#elif !USE_SENSORLESS && ENABLED(USES_DIAG_PINS)
#warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0)"
#endif

#if CANNOT_EMBED_CONFIGURATION
#warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
#endif
1 change: 0 additions & 1 deletion Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ namespace ExtUI {
}

void onStatusChanged(const char *lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); }
void onStatusChanged(FSTR_P lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); }

void onPrintTimerStarted() {
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ namespace Language_en {
PROGMEM Language_Str MSG_LEVELING = u8"Leveling";
PROGMEM Language_Str MSG_AXIS_LEVELING = u8"Axis Leveling";
PROGMEM Language_Str MSG_PROBE_BED = u8"Probe Mesh";
PROGMEM Language_Str MSG_MESH_VIEW = u8"View Mesh";
PROGMEM Language_Str MSG_PRINT_TEST = u8"Print Test (PLA)";
PROGMEM Language_Str MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top";

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/pin_mappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@
* 10 5V 5V 5V --> KILL [3]
*
* [1] This configuration allows daisy-chaining of the
* display and SD/USB on EXP2, except for [2]
* display and SD/FD on EXP2, except for [2]
*
* [2] The Ultimachine Einsy boards have a level shifter
* on MISO enabled by SD_CSEL chip select, hence it
* is not possible to run both the display and the
* SD/USB on EXP2.
* SD/FD on EXP2.
*
* [3] Archim Rambo provides 5V on this pin. On any other
* board, divert this wire from the ribbon cable and
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/language/language_de.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Language_de {
LSTR MSG_MEDIA_INSERTED = _UxGT("Medium erkannt");
LSTR MSG_MEDIA_REMOVED = _UxGT("Medium entfernt");
LSTR MSG_MEDIA_WAITING = _UxGT("Warten auf Medium");
LSTR MSG_SD_INIT_FAIL = _UxGT("SD Init fehlgesch.");
LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Medium Init fehlgesch.");
LSTR MSG_MEDIA_READ_ERROR = _UxGT("Medium Lesefehler");
LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB Gerät entfernt");
LSTR MSG_MEDIA_USB_FAILED = _UxGT("USB Start fehlge.");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/language/language_el.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Language_el {
LSTR MSG_MEDIA_READ_ERROR = MEDIA_TYPE_EN _UxGT(" σφάλμα ανάγνωσης");
LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB αφαιρέθη");
LSTR MSG_MEDIA_USB_FAILED = _UxGT("Αποτυχία εκκίνησης USB");
LSTR MSG_SD_INIT_FAIL = _UxGT("Αποτυχία αρχικοποίησης SD");
LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Αποτυχία αρχικοποίησης SD");
LSTR MSG_MAIN = _UxGT("Αρχική Οθόνη");
LSTR MSG_RUN_AUTO_FILES = _UxGT("Αυτόματη εκκίνηση");
LSTR MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση μοτέρ");
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ namespace Language_en {
LSTR MSG_MEDIA_ABORTING = _UxGT("Aborting...");
LSTR MSG_MEDIA_INSERTED = MEDIA_TYPE_EN _UxGT(" Inserted");
LSTR MSG_MEDIA_REMOVED = MEDIA_TYPE_EN _UxGT(" Removed");
LSTR MSG_MEDIA_WAITING = _UxGT("Waiting for card");
LSTR MSG_SD_INIT_FAIL = _UxGT("SD Init Fail");
LSTR MSG_MEDIA_WAITING = _UxGT("Waiting for ") MEDIA_TYPE_EN;
LSTR MSG_MEDIA_INIT_FAIL = MEDIA_TYPE_EN _UxGT(" Init Fail");
LSTR MSG_MEDIA_READ_ERROR = MEDIA_TYPE_EN _UxGT(" read error");
LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB device removed");
LSTR MSG_MEDIA_USB_FAILED = _UxGT("USB start failed");
Expand Down
22 changes: 11 additions & 11 deletions Marlin/src/lcd/language/language_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ namespace Language_es {
LSTR MSG_NO = _UxGT("NO");
LSTR MSG_BACK = _UxGT("Atrás");
LSTR MSG_MEDIA_ABORTING = _UxGT("Cancelando...");
LSTR MSG_MEDIA_INSERTED = _UxGT("SD/USB insertado");
LSTR MSG_MEDIA_REMOVED = _UxGT("SD/USB retirado");
LSTR MSG_MEDIA_WAITING = _UxGT("Esperando al SD/USB");
LSTR MSG_SD_INIT_FAIL = _UxGT("Fallo al iniciar SD");
LSTR MSG_MEDIA_READ_ERROR = _UxGT("Error lectura SD/USB");
LSTR MSG_MEDIA_INSERTED = _UxGT("SD/FD insertado");
LSTR MSG_MEDIA_REMOVED = _UxGT("SD/FD retirado");
LSTR MSG_MEDIA_WAITING = _UxGT("Esperando al SD/FD");
LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Fallo al iniciar SD/FD");
LSTR MSG_MEDIA_READ_ERROR = _UxGT("Error lectura SD/FD");
LSTR MSG_MEDIA_USB_REMOVED = _UxGT("Disp. USB retirado");
LSTR MSG_MEDIA_USB_FAILED = _UxGT("Inicio USB fallido");
LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Desbordamiento de subllamada");
Expand Down Expand Up @@ -325,7 +325,7 @@ namespace Language_es {
LSTR MSG_ERR_EEPROM_CRC = _UxGT("Err: EEPROM CRC");
LSTR MSG_ERR_EEPROM_INDEX = _UxGT("Err: Índice EEPROM");
LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Err: Versión EEPROM");
LSTR MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/USB");
LSTR MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/FD");
LSTR MSG_RESET_PRINTER = _UxGT("Resetear Impresora");
LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Recargar");
LSTR MSG_INFO_SCREEN = _UxGT("Pantalla de Inf.");
Expand All @@ -348,8 +348,8 @@ namespace Language_es {
LSTR MSG_CANCEL_OBJECT = _UxGT("Cancelar Objeto");
LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancelar Objeto =");
LSTR MSG_OUTAGE_RECOVERY = _UxGT("Rec. Fallo electrico");
LSTR MSG_MEDIA_MENU = _UxGT("Imprim. desde SD/USB");
LSTR MSG_NO_MEDIA = _UxGT("SD/USB no presente");
LSTR MSG_MEDIA_MENU = _UxGT("Imprim. desde SD/FD");
LSTR MSG_NO_MEDIA = _UxGT("SD/FD no presente");
LSTR MSG_DWELL = _UxGT("Reposo...");
LSTR MSG_USERWAIT = _UxGT("Pulsar para Reanudar");
LSTR MSG_PRINT_PAUSED = _UxGT("Impresión Pausada");
Expand Down Expand Up @@ -381,9 +381,9 @@ namespace Language_es {
LSTR MSG_FILAMENTUNLOAD = _UxGT("Descargar filamento");
LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Descargar fil. *");
LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Descargar todo");
LSTR MSG_ATTACH_MEDIA = _UxGT("Iniciar SD/USB");
LSTR MSG_CHANGE_MEDIA = _UxGT("Cambiar SD/USB");
LSTR MSG_RELEASE_MEDIA = _UxGT("Lanzar SD/USB");
LSTR MSG_ATTACH_MEDIA = _UxGT("Iniciar SD/FD");
LSTR MSG_CHANGE_MEDIA = _UxGT("Cambiar SD/FD");
LSTR MSG_RELEASE_MEDIA = _UxGT("Lanzar SD/FD");
LSTR MSG_ZPROBE_OUT = _UxGT("Sonda Z fuera cama");
LSTR MSG_SKEW_FACTOR = _UxGT("Factor de desviación");
LSTR MSG_BLTOUCH = _UxGT("BLTouch");
Expand Down
Loading

0 comments on commit 32b1ef7

Please sign in to comment.