@ -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
|
||||
|
||||
|
@ -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
|
||||
*/
|
||||
@ -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
|
||||
|
@ -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
|
||||
@ -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
|
||||
|
||||
/**
|
||||
@ -167,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 },
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -150,7 +150,7 @@
|
||||
* (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2)
|
||||
* RESET | 7 8 | PA9 (BTN_EN1)
|
||||
* (BTN_ENC) PA15 | 9 10 | PB5 (BEEPER)
|
||||
* ------
|
||||
* ------
|
||||
* EXP1
|
||||
*/
|
||||
#define EXP1_09_PIN PA15
|
||||
|
Reference in New Issue
Block a user