From 7c896a87a4742835c1ce149ddecc5847319e73b6 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 14 Dec 2022 00:56:34 +0100 Subject: [PATCH] Remove '*' (checksum) handling in process_commands The checksum is already removed from the command queue so there's no need to reprocess it in the main loop. --- Firmware/Marlin_main.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 903891d5f..b154282fc 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4046,7 +4046,6 @@ void process_commands() #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable - char *starpos = NULL; #ifdef ENABLE_AUTO_BED_LEVELING float x_tmp, y_tmp, z_tmp, real_z; #endif @@ -4074,9 +4073,6 @@ void process_commands() */ if (code_seen_P(PSTR("M117"))) //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" { - starpos = (strchr(strchr_pointer + 5, '*')); - if (starpos != NULL) - *(starpos) = '\0'; lcd_setstatus(strchr_pointer + 5); custom_message_type = CustomMsg::M117; } @@ -4107,8 +4103,6 @@ void process_commands() codenum = code_value_long() * 1000; // seconds to wait hasS = codenum > 0; } - starpos = strchr(src, '*'); - if (starpos != NULL) *(starpos) = '\0'; while (*src == ' ') ++src; custom_message_type = CustomMsg::M0Wait; if (!hasP && !hasS && *src != '\0') { @@ -5388,9 +5382,6 @@ void process_commands() */ case 23: - starpos = (strchr(strchr_pointer + 4,'*')); - if(starpos!=NULL) - *(starpos)='\0'; card.openFileReadFilteredGcode(strchr_pointer + 4, true); break; @@ -5464,12 +5455,6 @@ void process_commands() ### M28 - Start SD write M28: Begin write to SD card */ case 28: - starpos = (strchr(strchr_pointer + 4,'*')); - if(starpos != NULL){ - char* npos = strchr(CMDBUFFER_CURRENT_STRING, 'N'); - strchr_pointer = strchr(npos,' ') + 1; - *(starpos) = '\0'; - } card.openFileWrite(strchr_pointer+4); break; @@ -5491,12 +5476,6 @@ void process_commands() case 30: if (card.cardOK){ card.closefile(); - starpos = (strchr(strchr_pointer + 4,'*')); - if(starpos != NULL){ - char* npos = strchr(CMDBUFFER_CURRENT_STRING, 'N'); - strchr_pointer = strchr(npos,' ') + 1; - *(starpos) = '\0'; - } card.removeFile(strchr_pointer + 4); } break; @@ -5511,7 +5490,6 @@ void process_commands() st_synchronize(); } - starpos = (strchr(strchr_pointer + 4,'*')); const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. if(namestartpos==NULL) @@ -5521,9 +5499,6 @@ void process_commands() else namestartpos++; //to skip the '!' - if(starpos!=NULL) - *(starpos)='\0'; - bool call_procedure=(code_seen('P')); if(strchr_pointer>namestartpos) @@ -5560,12 +5535,6 @@ void process_commands() */ case 928: - starpos = (strchr(strchr_pointer + 5,'*')); - if(starpos != NULL){ - char* npos = strchr(CMDBUFFER_CURRENT_STRING, 'N'); - strchr_pointer = strchr(npos,' ') + 1; - *(starpos) = '\0'; - } card.openLogFile(strchr_pointer+5); break;