🎨 Macros for optional arguments (#21969)

This commit is contained in:
Scott Lahteine 2021-05-23 21:33:22 -05:00 committed by GitHub
parent 731370051d
commit 84fd0eff17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 120 additions and 351 deletions

View file

@ -84,9 +84,7 @@ char GCodeQueue::injected_commands[64]; // = { 0 }
void GCodeQueue::RingBuffer::commit_command(bool skip_ok
#if HAS_MULTI_SERIAL
, serial_index_t serial_ind/*=-1*/
#endif
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
) {
commands[index_w].skip_ok = skip_ok;
TERN_(HAS_MULTI_SERIAL, commands[index_w].port = serial_ind);
@ -100,9 +98,7 @@ void GCodeQueue::RingBuffer::commit_command(bool skip_ok
* Return false for a full buffer, or if the 'command' is a comment.
*/
bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/
#if HAS_MULTI_SERIAL
, serial_index_t serial_ind/*=-1*/
#endif
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
) {
if (*cmd == ';' || length >= BUFSIZE) return false;
strcpy(commands[index_w].buffer, cmd);