From 574e2d856ec1f80aab347c12afc6e7b7f1618d11 Mon Sep 17 00:00:00 2001 From: wurstnase Date: Thu, 16 Apr 2015 13:07:20 +0200 Subject: [PATCH] remove config --- Marlin/Marlin_main.cpp | 10 +++++++++- Marlin/language.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 64d3d1f350..b66f900950 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -263,6 +263,7 @@ static millis_t max_inactive_time = 0; static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L; millis_t print_job_start_ms = 0; ///< Print job start time millis_t print_job_stop_ms = 0; ///< Print job stop time +static millis_t last_command_time = 0; static uint8_t target_extruder; bool no_wait_for_cooling = true; bool target_direction; @@ -724,8 +725,15 @@ void get_command() { if (drain_queued_commands_P()) return; // priority is given to non-serial commands + millis_t ms = millis(); + + if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > 1000) { + SERIAL_ECHOLNPGM(MSG_WAIT); + last_command_time = ms; + } + while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) { - + last_command_time = ms; serial_char = MYSERIAL.read(); if (serial_char == '\n' || serial_char == '\r' || diff --git a/Marlin/language.h b/Marlin/language.h index ba5f3f700e..220f715e69 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -121,6 +121,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: "