Sfoglia il codice sorgente

Specify manual-movable E axes by extruder type

Scott Lahteine 9 anni fa
parent
commit
696b63e300
2 ha cambiato i file con 21 aggiunte e 16 eliminazioni
  1. 4
    0
      Marlin/Conditionals_post.h
  2. 17
    16
      Marlin/ultralcd.cpp

+ 4
- 0
Marlin/Conditionals_post.h Vedi File

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

+ 17
- 16
Marlin/ultralcd.cpp Vedi File

1316
    * to "current_position" after a short delay.
1316
    * to "current_position" after a short delay.
1317
    */
1317
    */
1318
   inline void manual_move_to_current(AxisEnum axis
1318
   inline void manual_move_to_current(AxisEnum axis
1319
-    #if EXTRUDERS > 1
1319
+    #if E_MANUAL > 1
1320
       , int8_t eindex=-1
1320
       , int8_t eindex=-1
1321
     #endif
1321
     #endif
1322
   ) {
1322
   ) {
1323
-    #if EXTRUDERS > 1
1323
+    #if E_MANUAL > 1
1324
       if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
1324
       if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
1325
     #endif
1325
     #endif
1326
     manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves
1326
     manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves
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]); }
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
   #endif
1358
   #endif
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]); }
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
     #endif
1363
     #endif
1364
   ) {
1364
   ) {
1365
     if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1365
     if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1368
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
1368
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
1369
       encoderPosition = 0;
1369
       encoderPosition = 0;
1370
       manual_move_to_current(E_AXIS
1370
       manual_move_to_current(E_AXIS
1371
-        #if E_STEPPERS > 1
1371
+        #if E_MANUAL > 1
1372
           , eindex
1372
           , eindex
1373
         #endif
1373
         #endif
1374
       );
1374
       );
1376
     }
1376
     }
1377
     if (lcdDrawUpdate) {
1377
     if (lcdDrawUpdate) {
1378
       PGM_P pos_label;
1378
       PGM_P pos_label;
1379
-      #if E_STEPPERS == 1
1379
+      #if E_MANUAL == 1
1380
         pos_label = PSTR(MSG_MOVE_E);
1380
         pos_label = PSTR(MSG_MOVE_E);
1381
       #else
1381
       #else
1382
         switch (eindex) {
1382
         switch (eindex) {
1383
           default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
1383
           default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
1384
           case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
1384
           case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
1385
-          #if E_STEPPERS > 2
1385
+          #if E_MANUAL > 2
1386
             case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
1386
             case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
1387
-            #if E_STEPPERS > 3
1387
+            #if E_MANUAL > 3
1388
               case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
1388
               case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
1389
             #endif
1389
             #endif
1390
           #endif
1390
           #endif
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
       #endif
1405
       #endif
1405
     #endif
1406
     #endif
1406
   #endif
1407
   #endif

Loading…
Annulla
Salva