Browse Source

Merge pull request #1922 from Wurstnase/serial_wait

Serial wait
pull/1/head
Scott Lahteine 10 years ago
parent
commit
8a0dc4d54a
  1. 8
      Marlin/Configuration_adv.h
  2. 21
      Marlin/Marlin_main.cpp
  3. 8
      Marlin/configurator/config/Configuration_adv.h
  4. 8
      Marlin/example_configurations/Felix/Configuration_adv.h
  5. 10
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  6. 8
      Marlin/example_configurations/K8200/Configuration_adv.h
  7. 8
      Marlin/example_configurations/SCARA/Configuration_adv.h
  8. 10
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  9. 8
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  10. 8
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  11. 8
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  12. 8
      Marlin/example_configurations/makibox/Configuration_adv.h
  13. 8
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  14. 1
      Marlin/language.h

8
Marlin/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

21
Marlin/Marlin_main.cpp

@ -733,8 +733,20 @@ void get_command() {
if (drain_queued_commands_P()) return; // priority is given to non-serial commands
while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
#ifdef NO_TIMEOUTS
static millis_t last_command_time = 0;
millis_t ms = millis();
if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > NO_TIMEOUTS) {
SERIAL_ECHOLNPGM(MSG_WAIT);
last_command_time = ms;
}
#endif
while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
#ifdef NO_TIMEOUTS
last_command_time = ms;
#endif
serial_char = MYSERIAL.read();
if (serial_char == '\n' || serial_char == '\r' ||
@ -5523,7 +5535,12 @@ void ClearToSend() {
#ifdef SDSUPPORT
if (fromsd[cmd_queue_index_r]) return;
#endif
SERIAL_PROTOCOLLNPGM(MSG_OK);
SERIAL_PROTOCOLPGM(MSG_OK);
#ifdef ADVANCED_OK
SERIAL_PROTOCOLPGM(" N"); SERIAL_PROTOCOL(gcode_LastN);
SERIAL_PROTOCOLPGM(" P"); SERIAL_PROTOCOL(BUFSIZE - commands_in_queue);
#endif
SERIAL_EOL;
}
void get_coordinates() {

8
Marlin/configurator/config/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/Felix/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

10
Marlin/example_configurations/Hephestos/Configuration_adv.h

@ -377,7 +377,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
//The ASCII buffer for receiving from the serial:
#define MAX_CMD_SIZE 96
#define BUFSIZE 5
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract

8
Marlin/example_configurations/K8200/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/SCARA/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

10
Marlin/example_configurations/WITBOX/Configuration_adv.h

@ -377,7 +377,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
//The ASCII buffer for receiving from the serial:
#define MAX_CMD_SIZE 96
#define BUFSIZE 5
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract

8
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h

@ -380,6 +380,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/delta/generic/Configuration_adv.h

@ -380,6 +380,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/makibox/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

8
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

@ -379,6 +379,14 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
#define NO_TIMEOUTS 1000
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
// @section fwretract
// Firmware based and LCD controlled retract

1
Marlin/language.h

@ -122,6 +122,7 @@
#define MSG_FREE_MEMORY " Free Memory: "
#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: "
#define MSG_OK "ok"
#define MSG_WAIT "wait"
#define MSG_FILE_SAVED "Done saving file."
#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: "
#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "

Loading…
Cancel
Save