From 95fff5367d9a02a20db157f36eae26dd85a21f42 Mon Sep 17 00:00:00 2001 From: kliment Date: Mon, 11 Apr 2011 00:02:59 +0200 Subject: Fix M28 to work with checksums - thanks to jeanmarc --- Tonokip_Firmware/Tonokip_Firmware.pde | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Tonokip_Firmware') 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); -- cgit v1.2.1