summaryrefslogtreecommitdiff
path: root/Tonokip_Firmware
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-04-11 00:02:59 +0200
committerkliment <kliment.yanev@gmail.com>2011-04-11 00:02:59 +0200
commit95fff5367d9a02a20db157f36eae26dd85a21f42 (patch)
tree54d3dbfaefa7041b3ab4543d6185923270fddd9c /Tonokip_Firmware
parent31936a2caabdd0d10a3332ca10ca83fb43d96ad8 (diff)
Fix M28 to work with checksums - thanks to jeanmarc
Diffstat (limited to 'Tonokip_Firmware')
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde12
1 files changed, 8 insertions, 4 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index a827856..58be003 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -561,14 +561,18 @@ inline void process_commands()
Serial.println("Not SD printing");
}
break;
- case 28: //M28 - Start SD write
+ case 28: //M28 - Start SD write
if(sdactive){
+ char* npos=0;
file.close();
sdmode=false;
starpos=(strchr(strchr_pointer+4,'*'));
- if(starpos!=NULL)
- *starpos='\0';
- if (!file.open(&root, strchr_pointer+4, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
+ if(starpos!=NULL){
+ npos=strchr(cmdbuffer[bufindr], 'N');
+ strchr_pointer = strchr(npos,' ')+1;
+ *starpos='\0';
+ }
+ if (!file.open(&root, strchr_pointer+4, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
{
Serial.print("open failed, File: ");
Serial.print(strchr_pointer+4);