@ -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 },
|
||||
|
Reference in New Issue
Block a user