From a2e412c0ce9865c170f72331052bb3b88a28ffce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 1 Sep 2019 20:21:11 -0500 Subject: [PATCH] Rename command buffer var --- Marlin/src/feature/power_loss_recovery.cpp | 2 +- Marlin/src/gcode/gcode.cpp | 4 ++-- Marlin/src/gcode/queue.cpp | 12 ++++++------ Marlin/src/gcode/queue.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index 5f826166a5..1c38e4f97a 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -212,7 +212,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= // Commands in the queue info.queue_length = save_queue ? queue.length : 0; info.queue_index_r = queue.index_r; - COPY(info.queue_buffer, queue.buffer); + COPY(info.queue_buffer, queue.command_buffer); // Elapsed print job time info.print_job_elapsed = print_job_timer.duration(); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 49503b9b5c..8ad818c925 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -812,7 +812,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { * This is called from the main loop() */ void GcodeSuite::process_next_command() { - char * const current_command = queue.buffer[queue.index_r]; + char * const current_command = queue.command_buffer[queue.index_r]; PORT_REDIRECT(queue.port[queue.index_r]); @@ -821,7 +821,7 @@ void GcodeSuite::process_next_command() { SERIAL_ECHOLN(current_command); #if ENABLED(M100_FREE_MEMORY_DUMPER) SERIAL_ECHOPAIR("slot:", queue.index_r); - M100_dump_routine(PSTR(" Command Queue:"), queue.buffer, queue.buffer + sizeof(queue.buffer)); + M100_dump_routine(PSTR(" Command Queue:"), queue.command_buffer, queue.command_buffer + sizeof(queue.command_buffer)); #endif } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 8159fa3285..e741b01fb4 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -64,7 +64,7 @@ uint8_t GCodeQueue::length = 0, // Count of commands in the queue GCodeQueue::index_r = 0, // Ring buffer read position GCodeQueue::index_w = 0; // Ring buffer write position -char GCodeQueue::buffer[BUFSIZE][MAX_CMD_SIZE]; +char GCodeQueue::command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on @@ -135,7 +135,7 @@ bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ #endif ) { if (*cmd == ';' || length >= BUFSIZE) return false; - strcpy(buffer[index_w], cmd); + strcpy(command_buffer[index_w], cmd); _commit_command(say_ok #if NUM_SERIAL > 1 , pn @@ -242,7 +242,7 @@ void GCodeQueue::ok_to_send() { if (!send_ok[index_r]) return; SERIAL_ECHOPGM(MSG_OK); #if ENABLED(ADVANCED_OK) - char* p = buffer[index_r]; + char* p = command_buffer[index_r]; if (*p == 'N') { SERIAL_ECHO(' '); SERIAL_ECHO(*p++); @@ -553,7 +553,7 @@ void GCodeQueue::get_serial_commands() { // Skip empty lines and comments if (!sd_count) { thermalManager.manage_heater(); continue; } - buffer[index_w][sd_count] = '\0'; // terminate string + command_buffer[index_w][sd_count] = '\0'; // terminate string sd_count = 0; // clear sd line buffer _commit_command(false); @@ -574,7 +574,7 @@ void GCodeQueue::get_serial_commands() { #if ENABLED(PAREN_COMMENTS) && ! sd_comment_paren_mode #endif - ) buffer[index_w][sd_count++] = sd_char; + ) command_buffer[index_w][sd_count++] = sd_char; } } } @@ -610,7 +610,7 @@ void GCodeQueue::advance() { #if ENABLED(SDSUPPORT) if (card.flag.saving) { - char* command = buffer[index_r]; + char* command = command_buffer[index_r]; if (is_M29(command)) { // M29 closes the file card.closefile(); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 671793e2bd..173cadc68e 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -51,7 +51,7 @@ public: static uint8_t length, // Count of commands in the queue index_r; // Ring buffer read position - static char buffer[BUFSIZE][MAX_CMD_SIZE]; + static char command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on