Merge pull request #4028 from DRracer/pr3322-updated

Merge duplicate strings in cmdqueue.cpp
This commit is contained in:
3d-gussner 2023-02-20 13:51:09 +01:00 committed by GitHub
commit 791b9b4d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -248,6 +248,9 @@ void cmdqueue_dump_to_serial()
}
#endif /* CMDBUFFER_DEBUG */
static const char bufferFull[] PROGMEM = "\" failed: Buffer full!";
static const char enqueingFront[] PROGMEM = "Enqueing to the front: \"";
//adds an command to the main command buffer
//thats really done in a non-safe way.
//needs overworking someday
@ -283,7 +286,7 @@ void enquecommand(const char *cmd, bool from_progmem)
SERIAL_PROTOCOLRPGM(cmd);
else
SERIAL_ECHO(cmd);
SERIAL_ECHOLNPGM("\" failed: Buffer full!");
SERIAL_ECHOLNRPGM(bufferFull);
#ifdef CMDBUFFER_DEBUG
cmdqueue_dump_to_serial();
#endif /* CMDBUFFER_DEBUG */
@ -307,7 +310,7 @@ void enquecommand_front(const char *cmd, bool from_progmem)
strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd);
++ buflen;
SERIAL_ECHO_START;
SERIAL_ECHOPGM("Enqueing to the front: \"");
SERIAL_ECHORPGM(enqueingFront);
SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE);
SERIAL_ECHOLNPGM("\"");
#ifdef CMDBUFFER_DEBUG
@ -315,12 +318,12 @@ void enquecommand_front(const char *cmd, bool from_progmem)
#endif /* CMDBUFFER_DEBUG */
} else {
SERIAL_ERROR_START;
SERIAL_ECHOPGM("Enqueing to the front: \"");
SERIAL_ECHORPGM(enqueingFront);
if (from_progmem)
SERIAL_PROTOCOLRPGM(cmd);
else
SERIAL_ECHO(cmd);
SERIAL_ECHOLNPGM("\" failed: Buffer full!");
SERIAL_ECHOLNRPGM(bufferFull);
#ifdef CMDBUFFER_DEBUG
cmdqueue_dump_to_serial();
#endif /* CMDBUFFER_DEBUG */