|
@ -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_r = 0, // Ring buffer read position
|
|
|
GCodeQueue::index_w = 0; // Ring buffer write 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 |
|
|
* The port that the command was received on |
|
@ -135,7 +135,7 @@ bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ |
|
|
#endif |
|
|
#endif |
|
|
) { |
|
|
) { |
|
|
if (*cmd == ';' || length >= BUFSIZE) return false; |
|
|
if (*cmd == ';' || length >= BUFSIZE) return false; |
|
|
strcpy(buffer[index_w], cmd); |
|
|
strcpy(command_buffer[index_w], cmd); |
|
|
_commit_command(say_ok |
|
|
_commit_command(say_ok |
|
|
#if NUM_SERIAL > 1 |
|
|
#if NUM_SERIAL > 1 |
|
|
, pn |
|
|
, pn |
|
@ -242,7 +242,7 @@ void GCodeQueue::ok_to_send() { |
|
|
if (!send_ok[index_r]) return; |
|
|
if (!send_ok[index_r]) return; |
|
|
SERIAL_ECHOPGM(MSG_OK); |
|
|
SERIAL_ECHOPGM(MSG_OK); |
|
|
#if ENABLED(ADVANCED_OK) |
|
|
#if ENABLED(ADVANCED_OK) |
|
|
char* p = buffer[index_r]; |
|
|
char* p = command_buffer[index_r]; |
|
|
if (*p == 'N') { |
|
|
if (*p == 'N') { |
|
|
SERIAL_ECHO(' '); |
|
|
SERIAL_ECHO(' '); |
|
|
SERIAL_ECHO(*p++); |
|
|
SERIAL_ECHO(*p++); |
|
@ -553,7 +553,7 @@ void GCodeQueue::get_serial_commands() { |
|
|
// Skip empty lines and comments
|
|
|
// Skip empty lines and comments
|
|
|
if (!sd_count) { thermalManager.manage_heater(); continue; } |
|
|
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
|
|
|
sd_count = 0; // clear sd line buffer
|
|
|
|
|
|
|
|
|
_commit_command(false); |
|
|
_commit_command(false); |
|
@ -574,7 +574,7 @@ void GCodeQueue::get_serial_commands() { |
|
|
#if ENABLED(PAREN_COMMENTS) |
|
|
#if ENABLED(PAREN_COMMENTS) |
|
|
&& ! sd_comment_paren_mode |
|
|
&& ! sd_comment_paren_mode |
|
|
#endif |
|
|
#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 ENABLED(SDSUPPORT) |
|
|
|
|
|
|
|
|
if (card.flag.saving) { |
|
|
if (card.flag.saving) { |
|
|
char* command = buffer[index_r]; |
|
|
char* command = command_buffer[index_r]; |
|
|
if (is_M29(command)) { |
|
|
if (is_M29(command)) { |
|
|
// M29 closes the file
|
|
|
// M29 closes the file
|
|
|
card.closefile(); |
|
|
card.closefile(); |
|
|