🐛 Ensure root for 'M503 C'

This commit is contained in:
Scott Lahteine 2023-04-04 20:46:46 -05:00
parent c25a6737c6
commit 80839cf020

View file

@ -26,7 +26,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(CONFIGURATION_EMBEDDING)
#include "../../sd/SdBaseFile.h"
#include "../../sd/cardreader.h"
#include "../../mczip.h"
#endif
@ -69,7 +69,7 @@ void GcodeSuite::M502() {
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())
if (file.open(card.getroot(), "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