Browse Source

Merge pull request #3414 from thinkyhead/rc_host_timeout_mods

Host Keepalive configurable timeout with 2s default
pull/1/head
Scott Lahteine 8 years ago
parent
commit
50c3140040
  1. 5
      Marlin/Configuration.h
  2. 4
      Marlin/Marlin.h
  3. 25
      Marlin/Marlin_main.cpp
  4. 5
      Marlin/example_configurations/Felix/Configuration.h
  5. 5
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  6. 5
      Marlin/example_configurations/Hephestos/Configuration.h
  7. 5
      Marlin/example_configurations/Hephestos_2/Configuration.h
  8. 5
      Marlin/example_configurations/K8200/Configuration.h
  9. 5
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  10. 5
      Marlin/example_configurations/RigidBot/Configuration.h
  11. 5
      Marlin/example_configurations/SCARA/Configuration.h
  12. 5
      Marlin/example_configurations/TAZ4/Configuration.h
  13. 5
      Marlin/example_configurations/WITBOX/Configuration.h
  14. 5
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  15. 5
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  16. 5
      Marlin/example_configurations/delta/generic/Configuration.h
  17. 5
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  18. 5
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  19. 5
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  20. 5
      Marlin/example_configurations/makibox/Configuration.h
  21. 5
      Marlin/example_configurations/tvrrug/Round2/Configuration.h

5
Marlin/Configuration.h

@ -721,9 +721,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

4
Marlin/Marlin.h

@ -327,6 +327,10 @@ extern bool axis_homed[3]; // axis[n].is_homed
extern float zprobe_zoffset;
#endif
#if ENABLED(HOST_KEEPALIVE_FEATURE)
extern uint8_t host_keepalive_interval;
#endif
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
extern float extrude_min_temp;
#endif

25
Marlin/Marlin_main.cpp

@ -155,6 +155,7 @@
* M110 - Set the current line number
* M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
* M112 - Emergency stop
* M113 - Get or set the timeout interval for Host Keepalive "busy" messages
* M114 - Output current position to serial port
* M115 - Capabilities string
* M117 - Display a message on the controller screen
@ -456,6 +457,7 @@ static bool send_ok[BUFSIZE];
static MarlinBusyState busy_state = NOT_BUSY;
static millis_t next_busy_signal_ms = -1;
uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
#define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0)
#else
#define host_keepalive() ;
@ -2297,7 +2299,7 @@ void unknown_command_error() {
break;
}
}
next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s
next_busy_signal_ms = host_keepalive_interval ? ms + 1000UL * host_keepalive_interval : -1;
}
#endif //HOST_KEEPALIVE_FEATURE
@ -4427,6 +4429,27 @@ inline void gcode_M111() {
*/
inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
#if ENABLED(HOST_KEEPALIVE_FEATURE)
/**
* M113: Get or set Host Keepalive interval (0 to disable)
*
* S<seconds> Optional. Set the keepalive interval.
*/
inline void gcode_M113() {
if (code_seen('S')) {
host_keepalive_interval = (uint8_t)code_value_short();
NOMORE(host_keepalive_interval, 60);
}
else {
SERIAL_ECHO_START;
SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval);
SERIAL_EOL;
}
}
#endif
#if ENABLED(BARICUDA)
#if HAS_HEATER_1

5
Marlin/example_configurations/Felix/Configuration.h

@ -704,9 +704,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/Felix/Configuration_DUAL.h

@ -701,9 +701,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/Hephestos/Configuration.h

@ -713,9 +713,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/Hephestos_2/Configuration.h

@ -715,9 +715,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/K8200/Configuration.h

@ -738,9 +738,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h

@ -721,9 +721,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/RigidBot/Configuration.h

@ -716,9 +716,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/SCARA/Configuration.h

@ -729,9 +729,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/TAZ4/Configuration.h

@ -742,9 +742,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/WITBOX/Configuration.h

@ -713,9 +713,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/adafruit/ST7565/Configuration.h

@ -721,9 +721,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/delta/biv2.5/Configuration.h

@ -843,9 +843,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/delta/generic/Configuration.h

@ -843,9 +843,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/delta/kossel_mini/Configuration.h

@ -847,9 +847,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/delta/kossel_pro/Configuration.h

@ -840,9 +840,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/delta/kossel_xl/Configuration.h

@ -757,9 +757,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/makibox/Configuration.h

@ -724,9 +724,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

5
Marlin/example_configurations/tvrrug/Round2/Configuration.h

@ -715,9 +715,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// Host Keepalive
//
// By default Marlin will send a busy status message to the host
// every 10 seconds when it can't accept commands.
// every couple of seconds when it can't accept commands.
//
//#define DISABLE_HOST_KEEPALIVE // Enable this option if your host doesn't like keepalive messages.
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#endif
//
// M100 Free Memory Watcher

Loading…
Cancel
Save