From 80839cf020b32971b4cb63f96a803c4fe19ce828 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <thinkyhead@users.noreply.github.com>
Date: Tue, 4 Apr 2023 20:46:46 -0500
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ensure=20root=20for=20'M503=20C'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/gcode/eeprom/M500-M504.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp
index 412d0033558..6da1d1cbd73 100644
--- a/Marlin/src/gcode/eeprom/M500-M504.cpp
+++ b/Marlin/src/gcode/eeprom/M500-M504.cpp
@@ -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