瀏覽代碼

Apply HAS_HOTEND_OFFSET where needed

Scott Lahteine 6 年之前
父節點
當前提交
d94e077901

+ 2
- 2
Marlin/src/gcode/calibrate/G34_M422.cpp 查看文件

230
 
230
 
231
     // Restore the active tool after homing
231
     // Restore the active tool after homing
232
     #if HOTENDS > 1
232
     #if HOTENDS > 1
233
-      tool_change(old_tool_index, 0,
233
+      tool_change(old_tool_index, 0, (
234
         #if ENABLED(PARKING_EXTRUDER)
234
         #if ENABLED(PARKING_EXTRUDER)
235
           false // Fetch the previous toolhead
235
           false // Fetch the previous toolhead
236
         #else
236
         #else
237
           true
237
           true
238
         #endif
238
         #endif
239
-      );
239
+      ));
240
     #endif
240
     #endif
241
 
241
 
242
     #if HAS_LEVELING
242
     #if HAS_LEVELING

+ 2
- 2
Marlin/src/gcode/calibrate/G425.cpp 查看文件

418
     SERIAL_EOL();
418
     SERIAL_EOL();
419
   }
419
   }
420
 
420
 
421
-  #if HOTENDS > 1
421
+  #if HAS_HOTEND_OFFSET
422
     //
422
     //
423
     // This function requires normalize_hotend_offsets() to be called
423
     // This function requires normalize_hotend_offsets() to be called
424
     //
424
     //
642
       report_measured_backlash(m);
642
       report_measured_backlash(m);
643
       report_measured_nozzle_dimensions(m);
643
       report_measured_nozzle_dimensions(m);
644
       report_measured_positional_error(m);
644
       report_measured_positional_error(m);
645
-      #if HOTENDS > 1
645
+      #if HAS_HOTEND_OFFSET
646
         normalize_hotend_offsets();
646
         normalize_hotend_offsets();
647
         report_hotend_offsets();
647
         report_hotend_offsets();
648
       #endif
648
       #endif

+ 1
- 1
Marlin/src/gcode/gcode.cpp 查看文件

516
         case 217: M217(); break;                                  // M217: Set filament swap parameters
516
         case 217: M217(); break;                                  // M217: Set filament swap parameters
517
       #endif
517
       #endif
518
 
518
 
519
-      #if HOTENDS > 1
519
+      #if HAS_HOTEND_OFFSET
520
         case 218: M218(); break;                                  // M218: Set a tool offset
520
         case 218: M218(); break;                                  // M218: Set a tool offset
521
       #endif
521
       #endif
522
 
522
 

+ 1
- 1
Marlin/src/gcode/gcode.h 查看文件

637
     static void M217();
637
     static void M217();
638
   #endif
638
   #endif
639
 
639
 
640
-  #if HOTENDS > 1
640
+  #if HAS_HOTEND_OFFSET
641
     static void M218();
641
     static void M218();
642
   #endif
642
   #endif
643
 
643
 

+ 1
- 1
Marlin/src/inc/Conditionals_post.h 查看文件

431
 /**
431
 /**
432
  * Default hotend offsets, if not defined
432
  * Default hotend offsets, if not defined
433
  */
433
  */
434
-#if HOTENDS > 1
434
+#if HAS_HOTEND_OFFSET
435
   #ifndef HOTEND_OFFSET_X
435
   #ifndef HOTEND_OFFSET_X
436
     #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
436
     #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
437
   #endif
437
   #endif

+ 1
- 6
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp 查看文件

580
 #if HAS_HEATED_BED
580
 #if HAS_HEATED_BED
581
   void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
581
   void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
582
     const bool show_target = target && FAR(temp, target);
582
     const bool show_target = target && FAR(temp, target);
583
-    draw_temps(1
584
-      #if HOTENDS > 1
585
-        + 1
586
-      #endif
587
-      , temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate
588
-    );
583
+    draw_temps(HOTENDS > 1 ? 2 : 1, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate);
589
     display_state.bed_show_target = show_target;
584
     display_state.bed_show_target = show_target;
590
   }
585
   }
591
 #endif
586
 #endif

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp 查看文件

530
     }
530
     }
531
   #endif // HAS_BED_PROBE
531
   #endif // HAS_BED_PROBE
532
 
532
 
533
-  #if HOTENDS > 1
533
+  #if HAS_HOTEND_OFFSET
534
 
534
 
535
     float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) {
535
     float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) {
536
       if (extruder - E0 >= HOTENDS) return 0;
536
       if (extruder - E0 >= HOTENDS) return 0;
552
       HOTEND_LOOP() hotend_offset[axis][e] -= offs;
552
       HOTEND_LOOP() hotend_offset[axis][e] -= offs;
553
     }
553
     }
554
 
554
 
555
-  #endif // HOTENDS > 1
555
+  #endif // HAS_HOTEND_OFFSET
556
 
556
 
557
   #if ENABLED(BACKLASH_GCODE)
557
   #if ENABLED(BACKLASH_GCODE)
558
     float getAxisBacklash_mm(const axis_t axis)       { return backlash_distance_mm[axis]; }
558
     float getAxisBacklash_mm(const axis_t axis)       { return backlash_distance_mm[axis]; }

+ 1
- 1
Marlin/src/lcd/extensible_ui/ui_api.h 查看文件

144
     void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles);
144
     void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles);
145
   #endif
145
   #endif
146
 
146
 
147
-  #if HOTENDS > 1
147
+  #if HAS_HOTEND_OFFSET
148
     float getNozzleOffset_mm(const axis_t, const extruder_t);
148
     float getNozzleOffset_mm(const axis_t, const extruder_t);
149
     void setNozzleOffset_mm(const float, const axis_t, const extruder_t);
149
     void setNozzleOffset_mm(const float, const axis_t, const extruder_t);
150
     void normalizeNozzleOffset(const axis_t axis);
150
     void normalizeNozzleOffset(const axis_t axis);

+ 20
- 18
Marlin/src/lcd/menu/menu_advanced.cpp 查看文件

300
   #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); //
300
   #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); //
301
 #endif
301
 #endif
302
 
302
 
303
-DEFINE_PIDTEMP_FUNCS(0);
304
-#if ENABLED(PID_PARAMS_PER_HOTEND)
305
-  #if HOTENDS > 1
306
-    DEFINE_PIDTEMP_FUNCS(1);
307
-    #if HOTENDS > 2
308
-      DEFINE_PIDTEMP_FUNCS(2);
309
-      #if HOTENDS > 3
310
-        DEFINE_PIDTEMP_FUNCS(3);
311
-        #if HOTENDS > 4
312
-          DEFINE_PIDTEMP_FUNCS(4);
313
-          #if HOTENDS > 5
314
-            DEFINE_PIDTEMP_FUNCS(5);
315
-          #endif // HOTENDS > 5
316
-        #endif // HOTENDS > 4
317
-      #endif // HOTENDS > 3
318
-    #endif // HOTENDS > 2
319
-  #endif // HOTENDS > 1
320
-#endif // PID_PARAMS_PER_HOTEND
303
+#if HOTENDS
304
+  DEFINE_PIDTEMP_FUNCS(0);
305
+  #if ENABLED(PID_PARAMS_PER_HOTEND)
306
+    #if HOTENDS > 1
307
+      DEFINE_PIDTEMP_FUNCS(1);
308
+      #if HOTENDS > 2
309
+        DEFINE_PIDTEMP_FUNCS(2);
310
+        #if HOTENDS > 3
311
+          DEFINE_PIDTEMP_FUNCS(3);
312
+          #if HOTENDS > 4
313
+            DEFINE_PIDTEMP_FUNCS(4);
314
+            #if HOTENDS > 5
315
+              DEFINE_PIDTEMP_FUNCS(5);
316
+            #endif // HOTENDS > 5
317
+          #endif // HOTENDS > 4
318
+        #endif // HOTENDS > 3
319
+      #endif // HOTENDS > 2
320
+    #endif // HOTENDS > 1
321
+  #endif // PID_PARAMS_PER_HOTEND
322
+#endif // HOTENDS
321
 
323
 
322
 #define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(PID_EDIT_MENU))
324
 #define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(PID_EDIT_MENU))
323
 
325
 

Loading…
取消
儲存