Browse Source

Disable is now multi extruder compatible. M84 got a T option.

Erik vd Zalm 12 years ago
parent
commit
0ac452e252
4 changed files with 35 additions and 16 deletions
  1. 1
    1
      Marlin/Configuration.h
  2. 1
    1
      Marlin/Configuration_adv.h
  3. 18
    4
      Marlin/Marlin_main.cpp
  4. 15
    10
      Marlin/planner.cpp

+ 1
- 1
Marlin/Configuration.h View File

@@ -46,7 +46,7 @@
46 46
 // 301 = Rambo
47 47
 
48 48
 #ifndef MOTHERBOARD
49
-#define MOTHERBOARD 7
49
+#define MOTHERBOARD 34
50 50
 #endif
51 51
 
52 52
 

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -71,7 +71,7 @@
71 71
 //===========================================================================
72 72
 
73 73
 // This defines the number of extruders
74
-#define EXTRUDERS 1
74
+#define EXTRUDERS 2
75 75
 
76 76
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
77 77
 

+ 18
- 4
Marlin/Marlin_main.cpp View File

@@ -1181,10 +1181,24 @@ void process_commands()
1181 1181
           if(code_seen('Z')) disable_z();
1182 1182
           #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS
1183 1183
             if(code_seen('E')) {
1184
-              disable_e0();
1185
-              disable_e1();
1186
-              disable_e2();
1187
-            }
1184
+              if(code_seen('T')) {
1185
+                tmp_extruder = code_value();
1186
+                if(tmp_extruder >= EXTRUDERS) {
1187
+                  SERIAL_ECHO_START;
1188
+                  SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
1189
+                }
1190
+                else {
1191
+                  if(tmp_extruder == 0) disable_e0();
1192
+                  else if(tmp_extruder == 1) disable_e1();
1193
+                  else if(tmp_extruder == 2) disable_e2();
1194
+               }
1195
+             }
1196
+             else {
1197
+               disable_e0();
1198
+               disable_e1();
1199
+               disable_e2();
1200
+             }
1201
+          }
1188 1202
           #endif 
1189 1203
         }
1190 1204
       }

+ 15
- 10
Marlin/planner.cpp View File

@@ -437,7 +437,9 @@ void check_axes_activity()
437 437
   unsigned char x_active = 0;
438 438
   unsigned char y_active = 0;  
439 439
   unsigned char z_active = 0;
440
-  unsigned char e_active = 0;
440
+  unsigned char e0_active = 0;
441
+  unsigned char e1_active = 0;
442
+  unsigned char e2_active = 0;
441 443
   unsigned char fan_speed = 0;
442 444
   unsigned char tail_fan_speed = 0;
443 445
   block_t *block;
@@ -452,7 +454,11 @@ void check_axes_activity()
452 454
       if(block->steps_x != 0) x_active++;
453 455
       if(block->steps_y != 0) y_active++;
454 456
       if(block->steps_z != 0) z_active++;
455
-      if(block->steps_e != 0) e_active++;
457
+      if(block->steps_e != 0) {
458
+         if(block->active_extruder == 0) e0_active++;
459
+         if(block->active_extruder == 1) e1_active++;
460
+         if(block->active_extruder == 2) e2_active++;
461
+      }
456 462
       if(block->fan_speed != 0) fan_speed++;
457 463
       block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
458 464
     }
@@ -470,11 +476,10 @@ void check_axes_activity()
470 476
   if((DISABLE_X) && (x_active == 0)) disable_x();
471 477
   if((DISABLE_Y) && (y_active == 0)) disable_y();
472 478
   if((DISABLE_Z) && (z_active == 0)) disable_z();
473
-  if((DISABLE_E) && (e_active == 0))
474
-  {
475
-    disable_e0();
476
-    disable_e1();
477
-    disable_e2(); 
479
+  if(DISABLE_E) {
480
+    if(e0_active == 0) disable_e0();
481
+    if(e1_active == 0) disable_e1();
482
+    if(e2_active == 0) disable_e2();
478 483
   }
479 484
 #if FAN_PIN > -1
480 485
   #ifndef FAN_SOFT_PWM
@@ -597,9 +602,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
597 602
   // Enable all
598 603
   if(block->steps_e != 0)
599 604
   {
600
-    enable_e0();
601
-    enable_e1();
602
-    enable_e2(); 
605
+    if(extruder == 0) enable_e0();
606
+    if(extruder == 1) enable_e1();
607
+    if(extruder == 2) enable_e2(); 
603 608
   }
604 609
 
605 610
   if (block->steps_e == 0)

Loading…
Cancel
Save