Browse Source

instant stop of sd prints from the panel.

Bernhard 13 years ago
parent
commit
82c99625fa
3 changed files with 11 additions and 1 deletions
  1. 1
    0
      Marlin/cardreader.pde
  2. 9
    0
      Marlin/stepper.cpp
  3. 1
    1
      Marlin/stepper.h

+ 1
- 0
Marlin/cardreader.pde View File

432
 
432
 
433
 void CardReader::printingHasFinished()
433
 void CardReader::printingHasFinished()
434
 {
434
 {
435
+ quickStop();
435
  sdprinting = false;
436
  sdprinting = false;
436
  if(SD_FINISHED_STEPPERRELEASE)
437
  if(SD_FINISHED_STEPPERRELEASE)
437
  {
438
  {

+ 9
- 0
Marlin/stepper.cpp View File

752
   disable_z(); 
752
   disable_z(); 
753
   disable_e(); 
753
   disable_e(); 
754
 }
754
 }
755
+
756
+void quickStop()
757
+{
758
+  DISABLE_STEPPER_DRIVER_INTERRUPT();
759
+  while(blocks_queued())
760
+    plan_discard_current_block();
761
+  ENABLE_STEPPER_DRIVER_INTERRUPT();
762
+}
763
+

+ 1
- 1
Marlin/stepper.h View File

52
 
52
 
53
 extern block_t *current_block;  // A pointer to the block currently being traced
53
 extern block_t *current_block;  // A pointer to the block currently being traced
54
 
54
 
55
-
55
+void quickStop();
56
 #endif
56
 #endif

Loading…
Cancel
Save