From fb9de6e7877bb2e04640fa731f8b30c0967ec215 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 7 Mar 2018 00:06:03 -0600
Subject: [PATCH 1/2] Add AUTO_REPORT_SD_STATUS feature

For parity with 2.0.x ahead of 1.1.9 release.
---
 Marlin/Configuration_adv.h |  5 +++++
 Marlin/Marlin_main.cpp     | 25 ++++++++++++++++++++++---
 Marlin/cardreader.cpp      | 13 +++++++++++++
 Marlin/cardreader.h        | 16 +++++++++++++++-
 4 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 3220c2f15d..506009c214 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -1410,6 +1410,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index ff35b97ece..7595cf4efa 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -89,7 +89,7 @@
  * M24  - Start/resume SD print. (Requires SDSUPPORT)
  * M25  - Pause SD print. (Requires SDSUPPORT)
  * M26  - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
- * M27  - Report SD print status. (Requires SDSUPPORT)
+ * M27  - Report SD print status. (Requires SDSUPPORT) Or, with 'S<seconds>' sets the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
  * M28  - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
  * M29  - Stop SD write. (Requires SDSUPPORT)
  * M30  - Delete file from SD: "M30 /path/file.gco"
@@ -6886,9 +6886,17 @@ inline void gcode_M17() {
   }
 
   /**
-   * M27: Get SD Card status
+   * M27: Get SD Card status or set the SD status auto-report interval.
+
    */
-  inline void gcode_M27() { card.getStatus(); }
+  inline void gcode_M27() {
+    #if ENABLED(AUTO_REPORT_SD_STATUS)
+      if (parser.seenval('S'))
+        card.set_auto_report_interval(parser.value_byte());
+      else
+    #endif
+        card.getStatus();
+  }
 
   /**
    * M28: Start SD Write
@@ -8636,6 +8644,13 @@ inline void gcode_M115() {
       #endif
     );
 
+    // AUTOREPORT_SD_STATUS (M27 extension)
+    cap_line(PSTR("AUTOREPORT_SD_STATUS")
+      #if ENABLED(AUTO_REPORT_SD_STATUS)
+        , true
+      #endif
+    );
+
   #endif // EXTENDED_CAPABILITIES_REPORT
 }
 
@@ -13467,6 +13482,10 @@ void idle(
       i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS;
     }
   #endif
+
+  #if ENABLED(AUTO_REPORT_SD_STATUS)
+    card.auto_report_sd_status();
+  #endif
 }
 
 /**
diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp
index 644bbe7fee..860ea17a9c 100644
--- a/Marlin/cardreader.cpp
+++ b/Marlin/cardreader.cpp
@@ -911,4 +911,17 @@ void CardReader::printingHasFinished() {
   }
 }
 
+#if ENABLED(AUTO_REPORT_SD_STATUS)
+  uint8_t CardReader::auto_report_sd_interval = 0;
+  millis_t CardReader::next_sd_report_ms;
+
+  void CardReader::auto_report_sd_status() {
+    millis_t current_ms = millis();
+    if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) {
+      next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval;
+      getStatus();
+    }
+  }
+#endif // AUTO_REPORT_SD_STATUS
+
 #endif // SDSUPPORT
diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h
index 5bcdd2b6b0..7b5ccdb9f3 100644
--- a/Marlin/cardreader.h
+++ b/Marlin/cardreader.h
@@ -90,10 +90,19 @@ public:
   FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
   FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
 
-public:
+  #if ENABLED(AUTO_REPORT_SD_STATUS)
+    void auto_report_sd_status(void);
+    FORCE_INLINE void set_auto_report_interval(uint8_t v) {
+      NOMORE(v, 60);
+      auto_report_sd_interval = v;
+      next_sd_report_ms = millis() + 1000UL * v;
+    }
+  #endif
+
   bool saving, logging, sdprinting, cardOK, filenameIsDir;
   char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
   int autostart_index;
+
 private:
   SdFile root, *curDir, workDir, workDirParents[MAX_DIR_DEPTH];
   uint8_t workDirDepth;
@@ -170,6 +179,11 @@ private:
   #if ENABLED(SDCARD_SORT_ALPHA)
     void flush_presort();
   #endif
+
+  #if ENABLED(AUTO_REPORT_SD_STATUS)
+    static uint8_t auto_report_sd_interval;
+    static millis_t next_sd_report_ms;
+  #endif
 };
 
 #if PIN_EXISTS(SD_DETECT)

From dc733192be27ded2e80111d575b2a1f17f4cd445 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 7 Mar 2018 00:06:17 -0600
Subject: [PATCH 2/2] Add AUTO_REPORT_SD_STATUS to example configs

---
 .../AlephObjects/TAZ4/Configuration_adv.h                    | 5 +++++
 Marlin/example_configurations/Anet/A6/Configuration_adv.h    | 5 +++++
 Marlin/example_configurations/Anet/A8/Configuration_adv.h    | 5 +++++
 .../example_configurations/BIBO/TouchX/Configuration_adv.h   | 5 +++++
 .../example_configurations/BQ/Hephestos/Configuration_adv.h  | 5 +++++
 .../BQ/Hephestos_2/Configuration_adv.h                       | 5 +++++
 Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h  | 5 +++++
 Marlin/example_configurations/Cartesio/Configuration_adv.h   | 5 +++++
 .../Creality/CR-10/Configuration_adv.h                       | 5 +++++
 .../Creality/CR-10S/Configuration_adv.h                      | 5 +++++
 .../Creality/CR-10mini/Configuration_adv.h                   | 5 +++++
 .../Creality/Ender-2/Configuration_adv.h                     | 5 +++++
 .../Creality/Ender-4/Configuration_adv.h                     | 5 +++++
 Marlin/example_configurations/Felix/Configuration_adv.h      | 5 +++++
 .../FolgerTech/i3-2020/Configuration_adv.h                   | 5 +++++
 .../Infitary/i3-M508/Configuration_adv.h                     | 5 +++++
 .../example_configurations/JGAurora/A5/Configuration_adv.h   | 5 +++++
 .../example_configurations/Malyan/M150/Configuration_adv.h   | 5 +++++
 .../Micromake/C1/enhanced/Configuration_adv.h                | 5 +++++
 Marlin/example_configurations/RigidBot/Configuration_adv.h   | 5 +++++
 Marlin/example_configurations/SCARA/Configuration_adv.h      | 5 +++++
 .../example_configurations/Sanguinololu/Configuration_adv.h  | 5 +++++
 Marlin/example_configurations/TinyBoy2/Configuration_adv.h   | 5 +++++
 .../Velleman/K8200/Configuration_adv.h                       | 5 +++++
 .../Velleman/K8400/Configuration_adv.h                       | 5 +++++
 .../Wanhao/Duplicator 6/Configuration_adv.h                  | 5 +++++
 .../delta/FLSUN/auto_calibrate/Configuration_adv.h           | 5 +++++
 .../delta/FLSUN/kossel/Configuration_adv.h                   | 5 +++++
 .../delta/FLSUN/kossel_mini/Configuration_adv.h              | 5 +++++
 .../example_configurations/delta/generic/Configuration_adv.h | 5 +++++
 .../delta/kossel_mini/Configuration_adv.h                    | 5 +++++
 .../delta/kossel_pro/Configuration_adv.h                     | 5 +++++
 .../delta/kossel_xl/Configuration_adv.h                      | 5 +++++
 .../gCreate/gMax1.5+/Configuration_adv.h                     | 5 +++++
 Marlin/example_configurations/makibox/Configuration_adv.h    | 5 +++++
 .../example_configurations/tvrrug/Round2/Configuration_adv.h | 5 +++++
 Marlin/example_configurations/wt150/Configuration_adv.h      | 5 +++++
 37 files changed, 185 insertions(+)

diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
index 85e7a2fa3b..eb9a4150ba 100644
--- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
+++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h
index 29919500b2..92d535f45d 100644
--- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h
+++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h
index 41f2137042..ad41730c75 100644
--- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h
+++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/BIBO/TouchX/Configuration_adv.h b/Marlin/example_configurations/BIBO/TouchX/Configuration_adv.h
index a52835e149..eb54a4b0b3 100644
--- a/Marlin/example_configurations/BIBO/TouchX/Configuration_adv.h
+++ b/Marlin/example_configurations/BIBO/TouchX/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
index a41186d725..3f742f31e9 100644
--- a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
+++ b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
index 4b00ab602e..2c6551b15f 100644
--- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
+++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
index a41186d725..3f742f31e9 100644
--- a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
+++ b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h
index 9dbf1639c3..b6e774c885 100644
--- a/Marlin/example_configurations/Cartesio/Configuration_adv.h
+++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
index f24cbb293e..9c02f37e5e 100755
--- a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
+++ b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
@@ -1412,6 +1412,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h
index 654378215f..9c778e246a 100644
--- a/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h
+++ b/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h
index 90bd54369c..06a13bb85e 100644
--- a/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h
+++ b/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h b/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h
index 0b9806a92d..2bb32eb2f1 100644
--- a/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h
+++ b/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h b/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h
index 2c1fd2a35b..7045a326ae 100644
--- a/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h
+++ b/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h
index 8264a5b159..644e27f40a 100644
--- a/Marlin/example_configurations/Felix/Configuration_adv.h
+++ b/Marlin/example_configurations/Felix/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
index 8139bf1422..c7844ae129 100644
--- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
+++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
@@ -1408,6 +1408,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
index 3e352e2d20..0e3597dca9 100644
--- a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
+++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 //#define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h b/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h
index b700424712..09d163ddfd 100644
--- a/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h
+++ b/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h
index 42d7fa7fb9..5552427c9c 100644
--- a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h
+++ b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
index 6788f5bacb..e5faba97d0 100644
--- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
+++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h
index def0523b7b..127b0dac85 100644
--- a/Marlin/example_configurations/RigidBot/Configuration_adv.h
+++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h
index f3dba70f10..0e4eda4997 100644
--- a/Marlin/example_configurations/SCARA/Configuration_adv.h
+++ b/Marlin/example_configurations/SCARA/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h
index 7ccc46352f..71db52910c 100644
--- a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h
+++ b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h
index dc7f8a50eb..d03e6c12de 100644
--- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h
+++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
index 25c67db684..5ed3073e11 100644
--- a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
+++ b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
@@ -1422,6 +1422,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
index 5dff916234..7117387807 100644
--- a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
+++ b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h
index 12fb5d8550..196ab753a0 100644
--- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h	
+++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h	
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
index 4f904ae5dc..d0371b2350 100644
--- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h
index 085a41dac7..abecf6b9ea 100644
--- a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
index f3ebbe8c3e..faa680ae01 100644
--- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h
index f3ebbe8c3e..faa680ae01 100644
--- a/Marlin/example_configurations/delta/generic/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
index f3ebbe8c3e..faa680ae01 100644
--- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
index 498a5e1809..76ee48d064 100644
--- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
@@ -1416,6 +1416,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
index 89b505990c..849aa6c2a9 100644
--- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
@@ -1411,6 +1411,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
index ec873dcff5..cac5377903 100644
--- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
+++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h
index 01115b2d38..3f67c32b39 100644
--- a/Marlin/example_configurations/makibox/Configuration_adv.h
+++ b/Marlin/example_configurations/makibox/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
index 08048cccca..bababbfef2 100644
--- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
+++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
@@ -1409,6 +1409,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */
diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h
index 9c6d6c6948..97aabd06b4 100644
--- a/Marlin/example_configurations/wt150/Configuration_adv.h
+++ b/Marlin/example_configurations/wt150/Configuration_adv.h
@@ -1410,6 +1410,11 @@
  */
 #define AUTO_REPORT_TEMPERATURES
 
+/**
+ * Auto-report SdCard status with M27 S<seconds>
+ */
+//#define AUTO_REPORT_SD_STATUS
+
 /**
  * Include capabilities in M115 output
  */