Browse Source

Also call clear_command_queue for lcd_sdcard_stop

Scott Lahteine 9 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
 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
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
 void enqueue_and_echo_command_now(const char* cmd); // enqueue now, only return when the command has been enqueued
255
 void enqueue_and_echo_command_now(const char* cmd); // enqueue now, only return when the command has been enqueued
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
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
 void clamp_to_software_endstops(float target[3]);
259
 void clamp_to_software_endstops(float target[3]);
259
 
260
 

+ 5
- 0
Marlin/Marlin_main.cpp View File

613
   drain_queued_commands_P(); // first command executed asap (when possible)
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
  * Once a new command is in the ring buffer, call this to commit it
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
   static void lcd_sdcard_stop() {
483
   static void lcd_sdcard_stop() {
484
     stepper.quick_stop();
484
     stepper.quick_stop();
485
     set_current_position_from_planner();
485
     set_current_position_from_planner();
486
+    clear_command_queue();
486
     card.sdprinting = false;
487
     card.sdprinting = false;
487
     card.closefile();
488
     card.closefile();
488
     print_job_timer.stop();
489
     print_job_timer.stop();

Loading…
Cancel
Save