From 461dad6e05d51a2582f4e6f2d0b13f959a2b18ba Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Sun, 14 Jul 2013 22:39:59 +0200 Subject: [PATCH] Added : M32 - Select file and start SD print (Can be used when printing from SD card) Untested --- Marlin/Marlin_main.cpp | 14 ++++++++++++++ Marlin/cardreader.cpp | 1 - README.md | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7053a96ec..eeec47139 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -84,6 +84,7 @@ // M29 - Stop SD write // M30 - Delete file from SD (M30 filename.g) // M31 - Output time since last M109 or SD card start to serial +// M32 - Select file and start SD print (Can be used when printing from SD card) // M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. // M80 - Turn on Power Supply // M81 - Turn off Power Supply @@ -1061,6 +1062,19 @@ void process_commands() card.removeFile(strchr_pointer + 4); } break; + case 32: //M32 - Select file and start SD print + if(card.sdprinting) { + st_synchronize(); + card.closefile(); + card.sdprinting = false; + } + starpos = (strchr(strchr_pointer + 4,'*')); + if(starpos!=NULL) + *(starpos-1)='\0'; + card.openFile(strchr_pointer + 4,true); + card.startFileprint(); + starttime=millis(); + break case 928: //M928 - Start SD write starpos = (strchr(strchr_pointer + 5,'*')); if(starpos != NULL){ diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 791c4bbe3..1eeec9193 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -206,7 +206,6 @@ void CardReader::startFileprint() if(cardOK) { sdprinting = true; - } } diff --git a/README.md b/README.md index 033224865..f5792ea06 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ M Codes * M29 - Stop SD write * M30 - Delete file from SD (M30 filename.g) * M31 - Output time since last M109 or SD card start to serial +* M32 - Select file and start SD print (Can be used when printing from SD card) * M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. * M80 - Turn on Power Supply * M81 - Turn off Power Supply