소스 검색

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

Erik vd Zalm 12 년 전
부모
커밋
0ac452e252
4개의 변경된 파일35개의 추가작업 그리고 16개의 파일을 삭제
  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 파일 보기

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

+ 1
- 1
Marlin/Configuration_adv.h 파일 보기

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

+ 18
- 4
Marlin/Marlin_main.cpp 파일 보기

1181
           if(code_seen('Z')) disable_z();
1181
           if(code_seen('Z')) disable_z();
1182
           #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS
1182
           #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS
1183
             if(code_seen('E')) {
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
           #endif 
1202
           #endif 
1189
         }
1203
         }
1190
       }
1204
       }

+ 15
- 10
Marlin/planner.cpp 파일 보기

437
   unsigned char x_active = 0;
437
   unsigned char x_active = 0;
438
   unsigned char y_active = 0;  
438
   unsigned char y_active = 0;  
439
   unsigned char z_active = 0;
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
   unsigned char fan_speed = 0;
443
   unsigned char fan_speed = 0;
442
   unsigned char tail_fan_speed = 0;
444
   unsigned char tail_fan_speed = 0;
443
   block_t *block;
445
   block_t *block;
452
       if(block->steps_x != 0) x_active++;
454
       if(block->steps_x != 0) x_active++;
453
       if(block->steps_y != 0) y_active++;
455
       if(block->steps_y != 0) y_active++;
454
       if(block->steps_z != 0) z_active++;
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
       if(block->fan_speed != 0) fan_speed++;
462
       if(block->fan_speed != 0) fan_speed++;
457
       block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
463
       block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
458
     }
464
     }
470
   if((DISABLE_X) && (x_active == 0)) disable_x();
476
   if((DISABLE_X) && (x_active == 0)) disable_x();
471
   if((DISABLE_Y) && (y_active == 0)) disable_y();
477
   if((DISABLE_Y) && (y_active == 0)) disable_y();
472
   if((DISABLE_Z) && (z_active == 0)) disable_z();
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
 #if FAN_PIN > -1
484
 #if FAN_PIN > -1
480
   #ifndef FAN_SOFT_PWM
485
   #ifndef FAN_SOFT_PWM
597
   // Enable all
602
   // Enable all
598
   if(block->steps_e != 0)
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
   if (block->steps_e == 0)
610
   if (block->steps_e == 0)

Loading…
취소
저장