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 6ec646498b..49745ed3be 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 f45cc228f5..293bc576b3 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 036dabcfe2..6f0f1e275f 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 5cefa13497..b891c7548d 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 696a438808..32fe7b0233 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 f45cc228f5..293bc576b3 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 4277dc084b..976c8a6753 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 5489fb2625..c731d05ab4 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 c76bb3ec51..b41769b6f8 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 5489fb2625..174322c2ff 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 ea377710f1..2b88d33ff1 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 93e4839438..a6d3f03425 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 db70fc8004..1a9da6a7c0 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 0ed83ced4b..97366e551d 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 ee6f41146f..6be8cf5369 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 18cb60a5a3..d348f243e4 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 3821294fd8..da88fbdff7 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 b0256bdba8..e7b4d61123 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 9dd1b45518..ad70145a26 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 38ba5dc690..6150890a03 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 b5c2462e2f..83fb60d85a 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 f5261896c8..64d24e2068 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 f556608b0b..d414587b95 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 1a26f360fc..79f7c1ad78 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 723da792be..07c0b16055 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 45b904a4a2..b3dff56022 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 a39d5f61cb..a003057482 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 9cdf807fe5..6cc2bc0b6a 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 1f61ccdf7b..2dbd9e34a5 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 78e17af5b7..f2f43938a0 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 666932ba43..91e1f8e32f 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 ded3c1301b..fbb1ecafbc 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 711a224806..22ffd0fe24 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 d7c5111ea2..f54b04b9bf 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 d7c5111ea2..f54b04b9bf 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 b675bfe18f..fdf756f2d6 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 b675bfe18f..fdf756f2d6 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 b675bfe18f..fdf756f2d6 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 0aa7d1303c..cafd719d99 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 cf2c11f1a7..ead0aaed70 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 d6fd8d023c..99453b1bc7 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 8902e3c22b..6612ec84dc 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 538e7d4595..e98c47e28c 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 2b47e6dea9..f41ef6403b 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 bce0cf3712..ef2d1dbfa2 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 b67238f2b2..007f21343b 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 9e4b7e96db..877c715c7f 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 12edd47166..7cca48e45a 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 cbe9d6f1f7..eca76cfc07 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 8d342fe42d..9d089fda9f 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)