diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 6ec646498..49745ed3b 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -547,6 +547,10 @@ void idle( } #endif + #if ENABLED(AUTO_REPORT_SD_STATUS) + card.auto_report_sd_status(); + #endif + #ifdef HAL_IDLETASK HAL_idletask(); #endif diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index f45cc228f..293bc576b 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 036dabcfe..6f0f1e275 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 5cefa1349..b891c7548 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 696a43880..32fe7b023 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h index f45cc228f..293bc576b 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h index 4277dc084..976c8a675 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 5489fb262..c731d05ab 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -1414,6 +1414,11 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Disable all Volumetric extrusion options */ diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index c76bb3ec5..b41769b6f 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 5489fb262..174322c2f 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index ea377710f..2b88d33ff 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 93e483943..a6d3f0342 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -1412,6 +1412,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index db70fc800..1a9da6a7c 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index 0ed83ced4..97366e551 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index ee6f41146..6be8cf536 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 18cb60a5a..d348f243e 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 3821294fd..da88fbdff 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index b0256bdba..e7b4d6112 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ //#define AUTO_REPORT_TEMPERATURES + +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index 9dd1b4551..ad70145a2 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 38ba5dc69..6150890a0 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -1410,6 +1410,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index b5c2462e2..83fb60d85 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index f5261896c..64d24e206 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index f556608b0..d414587b9 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index 1a26f360f..79f7c1ad7 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -1417,6 +1417,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index 723da792b..07c0b1605 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 45b904a4a..b3dff5602 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index a39d5f61c..a00305748 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index 9cdf807fe..6cc2bc0b6 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 1f61ccdf7..2dbd9e34a 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index 78e17af5b..f2f43938a 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 666932ba4..91e1f8e32 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -1422,6 +1422,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index ded3c1301..fbb1ecafb 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 711a22480..22ffd0fe2 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index d7c5111ea..f54b04b9b 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index d7c5111ea..f54b04b9b 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index b675bfe18..fdf756f2d 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index b675bfe18..fdf756f2d 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index b675bfe18..fdf756f2d 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index 0aa7d1303..cafd719d9 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -1416,6 +1416,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index cf2c11f1a..ead0aaed7 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -1411,6 +1411,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index d6fd8d023..99453b1bc 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index 8902e3c22..6612ec84d 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 538e7d459..e98c47e28 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -1409,6 +1409,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 2b47e6dea..f41ef6403 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -1410,6 +1410,11 @@ */ #define AUTO_REPORT_TEMPERATURES +/** + * Auto-report SdCard status with M27 S + */ +//#define AUTO_REPORT_SD_STATUS + /** * Include capabilities in M115 output */ diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index bce0cf371..ef2d1dbfa 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -85,7 +85,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) With 'S' 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" diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index b67238f2b..007f21343 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -139,5 +139,12 @@ void GcodeSuite::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 } diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp index 9e4b7e96d..877c715c7 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp @@ -115,6 +115,14 @@ void GcodeSuite::M27() { command_queue_port[cmd_queue_index_r] #endif ); + #if ENABLED(AUTO_REPORT_SD_STATUS) + if (parser.seenval('S')) + card.set_auto_report_interval(parser.value_byte() + #if NUM_SERIAL > 1 + , command_queue_port[cmd_queue_index_r] + #endif + ); + #endif } /** diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 12edd4716..7cca48e45 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -2603,7 +2603,7 @@ void kill_screen(const char* lcd_msg) { _lcd_goto_ubl_level_bed #else _lcd_ubl_level_bed - #endif + #endif ); #elif ENABLED(LCD_BED_LEVELING) #if ENABLED(PROBE_MANUALLY) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index cbe9d6f1f..eca76cfc0 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -536,7 +536,7 @@ void CardReader::getStatus( const int8_t port/*= -1*/ #endif ) { - if (cardOK) { + if (cardOK && sdprinting) { SERIAL_PROTOCOLPGM_P(port, MSG_SD_PRINTING_BYTE); SERIAL_PROTOCOL_P(port, sdpos); SERIAL_PROTOCOLCHAR_P(port, '/'); @@ -947,4 +947,24 @@ void CardReader::printingHasFinished() { } } +#if ENABLED(AUTO_REPORT_SD_STATUS) + uint8_t CardReader::auto_report_sd_interval = 0; + millis_t CardReader::next_sd_report_ms; + #if NUM_SERIAL > 1 + int8_t CardReader::serialport; + #endif + + 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( + #if NUM_SERIAL > 1 + serialport + #endif + ); + } + } +#endif // AUTO_REPORT_SD_STATUS + #endif // SDSUPPORT diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 8d342fe42..9d089fda9 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -99,6 +99,23 @@ public: FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } Sd2Card& getSd2Card() { return card; } + + #if ENABLED(AUTO_REPORT_SD_STATUS) + void auto_report_sd_status(void); + FORCE_INLINE void set_auto_report_interval(uint8_t v + #if NUM_SERIAL > 1 + , int8_t port + #endif + ) { + #if NUM_SERIAL > 1 + serialport = port; + #endif + NOMORE(v, 60); + auto_report_sd_interval = v; + next_sd_report_ms = millis() + 1000UL * v; + } + #endif + public: bool saving, logging, sdprinting, cardOK, filenameIsDir; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; @@ -183,6 +200,14 @@ 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; + #if NUM_SERIAL > 1 + static int8_t serialport; + #endif + #endif }; #if PIN_EXISTS(SD_DETECT)