Browse Source

make 'wait' optional and mark as workaround

pull/1/head
Wurstnase 10 years ago
parent
commit
b09a957fce
  1. 4
      Marlin/Configuration_adv.h
  2. 4
      Marlin/Marlin_main.cpp

4
Marlin/Configuration_adv.h

@ -374,6 +374,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96 #define MAX_CMD_SIZE 96
#define BUFSIZE 4 #define BUFSIZE 4
// Some Hosts doesn't have a timeout for resend a command.
// This is a workaround for them. If your printer sometimes stuck and stop printing this could help.
// #define NO_TIMEOUTS
// @section fwretract // @section fwretract
// Firmware based and LCD controlled retract // Firmware based and LCD controlled retract

4
Marlin/Marlin_main.cpp

@ -724,6 +724,7 @@ void get_command() {
if (drain_queued_commands_P()) return; // priority is given to non-serial commands if (drain_queued_commands_P()) return; // priority is given to non-serial commands
#ifdef NO_TIMEOUTS
static millis_t last_command_time = 0; static millis_t last_command_time = 0;
millis_t ms = millis(); millis_t ms = millis();
@ -731,9 +732,12 @@ void get_command() {
SERIAL_ECHOLNPGM(MSG_WAIT); SERIAL_ECHOLNPGM(MSG_WAIT);
last_command_time = ms; last_command_time = ms;
} }
#endif
while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) { while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
#ifdef NO_TIMEOUTS
last_command_time = ms; last_command_time = ms;
#endif
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
if (serial_char == '\n' || serial_char == '\r' || if (serial_char == '\n' || serial_char == '\r' ||

Loading…
Cancel
Save