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.
This commit is contained in:
Yuri D'Elia 2022-12-14 00:56:34 +01:00 committed by DRracer
parent 6651f5ce8b
commit 7c896a87a4
1 changed files with 0 additions and 31 deletions

View File

@ -4046,7 +4046,6 @@ void process_commands()
#endif /* CMDBUFFER_DEBUG */ #endif /* CMDBUFFER_DEBUG */
unsigned long codenum; //throw away variable unsigned long codenum; //throw away variable
char *starpos = NULL;
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
float x_tmp, y_tmp, z_tmp, real_z; float x_tmp, y_tmp, z_tmp, real_z;
#endif #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 "^" 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); lcd_setstatus(strchr_pointer + 5);
custom_message_type = CustomMsg::M117; custom_message_type = CustomMsg::M117;
} }
@ -4107,8 +4103,6 @@ void process_commands()
codenum = code_value_long() * 1000; // seconds to wait codenum = code_value_long() * 1000; // seconds to wait
hasS = codenum > 0; hasS = codenum > 0;
} }
starpos = strchr(src, '*');
if (starpos != NULL) *(starpos) = '\0';
while (*src == ' ') ++src; while (*src == ' ') ++src;
custom_message_type = CustomMsg::M0Wait; custom_message_type = CustomMsg::M0Wait;
if (!hasP && !hasS && *src != '\0') { if (!hasP && !hasS && *src != '\0') {
@ -5388,9 +5382,6 @@ void process_commands()
*/ */
case 23: case 23:
starpos = (strchr(strchr_pointer + 4,'*'));
if(starpos!=NULL)
*(starpos)='\0';
card.openFileReadFilteredGcode(strchr_pointer + 4, true); card.openFileReadFilteredGcode(strchr_pointer + 4, true);
break; break;
@ -5464,12 +5455,6 @@ void process_commands()
### M28 - Start SD write <a href="https://reprap.org/wiki/G-code#M28:_Begin_write_to_SD_card">M28: Begin write to SD card</a> ### M28 - Start SD write <a href="https://reprap.org/wiki/G-code#M28:_Begin_write_to_SD_card">M28: Begin write to SD card</a>
*/ */
case 28: 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); card.openFileWrite(strchr_pointer+4);
break; break;
@ -5491,12 +5476,6 @@ void process_commands()
case 30: case 30:
if (card.cardOK){ if (card.cardOK){
card.closefile(); 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); card.removeFile(strchr_pointer + 4);
} }
break; break;
@ -5511,7 +5490,6 @@ void process_commands()
st_synchronize(); st_synchronize();
} }
starpos = (strchr(strchr_pointer + 4,'*'));
const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start.
if(namestartpos==NULL) if(namestartpos==NULL)
@ -5521,9 +5499,6 @@ void process_commands()
else else
namestartpos++; //to skip the '!' namestartpos++; //to skip the '!'
if(starpos!=NULL)
*(starpos)='\0';
bool call_procedure=(code_seen('P')); bool call_procedure=(code_seen('P'));
if(strchr_pointer>namestartpos) if(strchr_pointer>namestartpos)
@ -5560,12 +5535,6 @@ void process_commands()
*/ */
case 928: 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); card.openLogFile(strchr_pointer+5);
break; break;