From eb079959fb320f99cfa885e576fed23e7aa3354f Mon Sep 17 00:00:00 2001 From: TheSFReader Date: Mon, 26 Feb 2018 22:38:27 +0100 Subject: [PATCH] Report sd card progress [FR] #9751 (#9832) * SD Status auto-report feature Feature Request #9751 --- Marlin/src/Marlin.cpp | 4 +++ Marlin/src/config/default/Configuration_adv.h | 5 ++++ .../AlephObjects/TAZ4/Configuration_adv.h | 5 ++++ .../examples/Anet/A6/Configuration_adv.h | 5 ++++ .../examples/Anet/A8/Configuration_adv.h | 5 ++++ .../examples/Azteeg/X5GT/Configuration_adv.h | 5 ++++ .../examples/BIBO/TouchX/Configuration_adv.h | 5 ++++ .../examples/BQ/Hephestos/Configuration_adv.h | 5 ++++ .../BQ/Hephestos_2/Configuration_adv.h | 5 ++++ .../examples/BQ/WITBOX/Configuration_adv.h | 5 ++++ .../examples/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 ++++ .../config/examples/Felix/Configuration_adv.h | 5 ++++ .../FolgerTech/i3-2020/Configuration_adv.h | 5 ++++ .../Infitary/i3-M508/Configuration_adv.h | 5 ++++ .../examples/JGAurora/A5/Configuration_adv.h | 5 ++++ .../examples/MakerParts/Configuration_adv.h | 5 ++++ .../examples/Malyan/M150/Configuration_adv.h | 5 ++++ .../examples/Malyan/M200/Configuration_adv.h | 5 ++++ .../Micromake/C1/enhanced/Configuration_adv.h | 5 ++++ .../examples/Mks/Sbase/Configuration_adv.h | 5 ++++ .../examples/RigidBot/Configuration_adv.h | 5 ++++ .../config/examples/SCARA/Configuration_adv.h | 5 ++++ .../examples/Sanguinololu/Configuration_adv.h | 5 ++++ .../examples/TheBorg/Configuration_adv.h | 5 ++++ .../examples/TinyBoy2/Configuration_adv.h | 5 ++++ .../UltiMachine/Archim2/Configuration_adv.h | 5 ++++ .../Velleman/K8200/Configuration_adv.h | 5 ++++ .../Velleman/K8400/Configuration_adv.h | 5 ++++ .../Wanhao/Duplicator 6/Configuration_adv.h | 5 ++++ .../FLSUN/auto_calibrate/Configuration_adv.h | 5 ++++ .../delta/FLSUN/kossel/Configuration_adv.h | 5 ++++ .../FLSUN/kossel_mini/Configuration_adv.h | 5 ++++ .../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 ++++ .../examples/makibox/Configuration_adv.h | 5 ++++ .../tvrrug/Round2/Configuration_adv.h | 5 ++++ .../config/examples/wt150/Configuration_adv.h | 5 ++++ Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M115.cpp | 7 ++++++ .../src/gcode/sdcard/M20-M30_M32-M34_M928.cpp | 8 ++++++ Marlin/src/lcd/ultralcd.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 22 +++++++++++++++- Marlin/src/sd/cardreader.h | 25 +++++++++++++++++++ 50 files changed, 282 insertions(+), 3 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 6ec646498b0..49745ed3be6 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 f45cc228f52..293bc576b38 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 036dabcfe28..6f0f1e275fe 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 5cefa13497a..b891c7548d8 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 696a4388089..32fe7b02332 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 f45cc228f52..293bc576b38 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 4277dc084be..976c8a6753a 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 5489fb26258..c731d05ab44 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 c76bb3ec51d..b41769b6f85 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 5489fb26258..174322c2ff0 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 ea377710f1d..2b88d33ff1d 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 93e48394384..a6d3f034252 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 db70fc8004f..1a9da6a7c0d 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 0ed83ced4b4..97366e551d4 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 ee6f41146f5..6be8cf5369a 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 18cb60a5a36..d348f243e45 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 3821294fd86..da88fbdff7c 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 b0256bdba83..e7b4d611232 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 9dd1b45518c..ad70145a260 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 38ba5dc690c..6150890a03a 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 b5c2462e2f4..83fb60d85a2 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 f5261896c88..64d24e20682 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 f556608b0b1..d414587b956 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 1a26f360fca..79f7c1ad78b 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 723da792be7..07c0b16055e 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 45b904a4a27..b3dff560222 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 a39d5f61cb2..a0030574824 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 9cdf807fe5b..6cc2bc0b6a7 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 1f61ccdf7b1..2dbd9e34a59 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 78e17af5b76..f2f43938a04 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 666932ba43a..91e1f8e32fc 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 ded3c1301b6..fbb1ecafbcb 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 711a224806c..22ffd0fe244 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 d7c5111ea20..f54b04b9bf2 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 d7c5111ea20..f54b04b9bf2 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 b675bfe18fe..fdf756f2d60 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 b675bfe18fe..fdf756f2d60 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 b675bfe18fe..fdf756f2d60 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 0aa7d1303c4..cafd719d995 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 cf2c11f1a70..ead0aaed701 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 d6fd8d023c0..99453b1bc74 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 8902e3c22b0..6612ec84dc3 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 538e7d45951..e98c47e28c8 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 2b47e6dea98..f41ef6403b4 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 bce0cf37122..ef2d1dbfa28 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 b67238f2b2b..007f21343b2 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 9e4b7e96db7..877c715c7f2 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 12edd471662..7cca48e45a4 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 cbe9d6f1f71..eca76cfc071 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 8d342fe42d4..9d089fda9f8 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)