diff options
author | kliment <kliment.yanev@gmail.com> | 2011-04-07 10:57:26 +0200 |
---|---|---|
committer | kliment <kliment.yanev@gmail.com> | 2011-04-07 10:57:26 +0200 |
commit | c0ccdd0438f7fd511ee1dded70ab1074afc1fcb9 (patch) | |
tree | 31bd65aae1768ff2c01118eab68c3be98fc43d08 /Tonokip_Firmware | |
parent | aad7c19db818f3e879fbba225b8485fa0d52adee (diff) |
Remove checksum from M28 and M23 commands
Diffstat (limited to 'Tonokip_Firmware')
-rw-r--r-- | Tonokip_Firmware/Tonokip_Firmware.pde | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde index 3014d4b..659d0db 100644 --- a/Tonokip_Firmware/Tonokip_Firmware.pde +++ b/Tonokip_Firmware/Tonokip_Firmware.pde @@ -502,6 +502,9 @@ inline void process_commands() if(sdactive){ sdmode=false; file.close(); + starpos=(strchr(strchr_pointer+4,'*')); + if(starpos!=NULL) + *starpos='\0'; if (file.open(&root, strchr_pointer+4, O_READ)) { Serial.print("File opened:"); Serial.print(strchr_pointer+4); @@ -543,20 +546,22 @@ inline void process_commands() } break; case 28: //M28 - Start SD write - 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)) - { - Serial.print("open failed, File: "); - Serial.print(strchr_pointer+4); - Serial.print("."); - }else{ - savetosd = true; - Serial.print("Writing to file: "); - Serial.println(strchr_pointer+4); + if(sdactive){ + 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)) + { + Serial.print("open failed, File: "); + Serial.print(strchr_pointer+4); + Serial.print("."); + }else{ + savetosd = true; + Serial.print("Writing to file: "); + Serial.println(strchr_pointer+4); + } } break; case 29: //M29 - Stop SD write |