瀏覽代碼

Specify manual-movable E axes by extruder type

Scott Lahteine 9 年之前
父節點
當前提交
696b63e300
共有 2 個文件被更改,包括 21 次插入16 次删除
  1. 4
    0
      Marlin/Conditionals_post.h
  2. 17
    16
      Marlin/ultralcd.cpp

+ 4
- 0
Marlin/Conditionals_post.h 查看文件

@@ -322,6 +322,7 @@
322 322
   #if ENABLED(SINGLENOZZLE)             // One hotend, multi-extruder
323 323
     #define HOTENDS      1
324 324
     #define E_STEPPERS   EXTRUDERS
325
+    #define E_MANUAL     EXTRUDERS
325 326
     #define TOOL_E_INDEX current_block->active_extruder
326 327
     #undef TEMP_SENSOR_1_AS_REDUNDANT
327 328
     #undef HOTEND_OFFSET_X
@@ -329,6 +330,7 @@
329 330
   #elif ENABLED(SWITCHING_EXTRUDER)     // One E stepper, unified E axis, two hotends
330 331
     #define HOTENDS      EXTRUDERS
331 332
     #define E_STEPPERS   1
333
+    #define E_MANUAL     1
332 334
     #define TOOL_E_INDEX 0
333 335
     #ifndef HOTEND_OFFSET_Z
334 336
       #define HOTEND_OFFSET_Z { 0 }
@@ -336,10 +338,12 @@
336 338
   #elif ENABLED(MIXING_EXTRUDER)        // Multi-stepper, unified E axis, one hotend
337 339
     #define HOTENDS      1
338 340
     #define E_STEPPERS   MIXING_STEPPERS
341
+    #define E_MANUAL     1
339 342
     #define TOOL_E_INDEX 0
340 343
   #else                                 // One stepper, E axis, and hotend per tool
341 344
     #define HOTENDS      EXTRUDERS
342 345
     #define E_STEPPERS   EXTRUDERS
346
+    #define E_MANUAL     EXTRUDERS
343 347
     #define TOOL_E_INDEX current_block->active_extruder
344 348
   #endif
345 349
 

+ 17
- 16
Marlin/ultralcd.cpp 查看文件

@@ -1316,11 +1316,11 @@ void kill_screen(const char* lcd_msg) {
1316 1316
    * to "current_position" after a short delay.
1317 1317
    */
1318 1318
   inline void manual_move_to_current(AxisEnum axis
1319
-    #if EXTRUDERS > 1
1319
+    #if E_MANUAL > 1
1320 1320
       , int8_t eindex=-1
1321 1321
     #endif
1322 1322
   ) {
1323
-    #if EXTRUDERS > 1
1323
+    #if E_MANUAL > 1
1324 1324
       if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
1325 1325
     #endif
1326 1326
     manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves
@@ -1357,9 +1357,9 @@ void kill_screen(const char* lcd_msg) {
1357 1357
     static void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); }
1358 1358
   #endif
1359 1359
   static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); }
1360
-  static void lcd_move_e(
1361
-    #if E_STEPPERS > 1
1362
-      int8_t eindex = -1
1360
+  static void _lcd_move_e(
1361
+    #if E_MANUAL > 1
1362
+      int8_t eindex
1363 1363
     #endif
1364 1364
   ) {
1365 1365
     if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
@@ -1368,7 +1368,7 @@ void kill_screen(const char* lcd_msg) {
1368 1368
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
1369 1369
       encoderPosition = 0;
1370 1370
       manual_move_to_current(E_AXIS
1371
-        #if E_STEPPERS > 1
1371
+        #if E_MANUAL > 1
1372 1372
           , eindex
1373 1373
         #endif
1374 1374
       );
@@ -1376,15 +1376,15 @@ void kill_screen(const char* lcd_msg) {
1376 1376
     }
1377 1377
     if (lcdDrawUpdate) {
1378 1378
       PGM_P pos_label;
1379
-      #if E_STEPPERS == 1
1379
+      #if E_MANUAL == 1
1380 1380
         pos_label = PSTR(MSG_MOVE_E);
1381 1381
       #else
1382 1382
         switch (eindex) {
1383 1383
           default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
1384 1384
           case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
1385
-          #if E_STEPPERS > 2
1385
+          #if E_MANUAL > 2
1386 1386
             case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
1387
-            #if E_STEPPERS > 3
1387
+            #if E_MANUAL > 3
1388 1388
               case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
1389 1389
             #endif
1390 1390
           #endif
@@ -1394,13 +1394,14 @@ void kill_screen(const char* lcd_msg) {
1394 1394
     }
1395 1395
   }
1396 1396
 
1397
-  #if E_STEPPERS > 1
1398
-    static void lcd_move_e0() { lcd_move_e(0); }
1399
-    static void lcd_move_e1() { lcd_move_e(1); }
1400
-    #if E_STEPPERS > 2
1401
-      static void lcd_move_e2() { lcd_move_e(2); }
1402
-      #if E_STEPPERS > 3
1403
-        static void lcd_move_e3() { lcd_move_e(3); }
1397
+  static void lcd_move_e() { _lcd_move_e(); }
1398
+  #if E_MANUAL > 1
1399
+    static void lcd_move_e0() { _lcd_move_e(0); }
1400
+    static void lcd_move_e1() { _lcd_move_e(1); }
1401
+    #if E_MANUAL > 2
1402
+      static void lcd_move_e2() { _lcd_move_e(2); }
1403
+      #if E_MANUAL > 3
1404
+        static void lcd_move_e3() { _lcd_move_e(3); }
1404 1405
       #endif
1405 1406
     #endif
1406 1407
   #endif

Loading…
取消
儲存