Browse Source

Also call clear_command_queue for lcd_sdcard_stop

Scott Lahteine 8 years ago
parent
commit
064efb20e0
3 changed files with 7 additions and 0 deletions
  1. 1
    0
      Marlin/Marlin.h
  2. 5
    0
      Marlin/Marlin_main.cpp
  3. 1
    0
      Marlin/ultralcd.cpp

+ 1
- 0
Marlin/Marlin.h View File

@@ -254,6 +254,7 @@ inline bool IsStopped() { return !Running; }
254 254
 bool enqueue_and_echo_command(const char* cmd, bool say_ok=false); //put a single ASCII command at the end of the current buffer or return false when it is full
255 255
 void enqueue_and_echo_command_now(const char* cmd); // enqueue now, only return when the command has been enqueued
256 256
 void enqueue_and_echo_commands_P(const char* cmd); //put one or many ASCII commands at the end of the current buffer, read from flash
257
+void clear_command_queue();
257 258
 
258 259
 void clamp_to_software_endstops(float target[3]);
259 260
 

+ 5
- 0
Marlin/Marlin_main.cpp View File

@@ -613,6 +613,11 @@ void enqueue_and_echo_commands_P(const char* pgcode) {
613 613
   drain_queued_commands_P(); // first command executed asap (when possible)
614 614
 }
615 615
 
616
+void clear_command_queue() {
617
+  cmd_queue_index_r = cmd_queue_index_w;
618
+  commands_in_queue = 0;
619
+}
620
+
616 621
 /**
617 622
  * Once a new command is in the ring buffer, call this to commit it
618 623
  */

+ 1
- 0
Marlin/ultralcd.cpp View File

@@ -483,6 +483,7 @@ inline void line_to_current(AxisEnum axis) {
483 483
   static void lcd_sdcard_stop() {
484 484
     stepper.quick_stop();
485 485
     set_current_position_from_planner();
486
+    clear_command_queue();
486 487
     card.sdprinting = false;
487 488
     card.closefile();
488 489
     print_job_timer.stop();

Loading…
Cancel
Save