소스 검색

More IntelliSense-friendly declarations

Scott Lahteine 4 년 전
부모
커밋
2d2291d00e

+ 3
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp 파일 보기

303
 
303
 
304
   const int8_t p_val = parser.intval('P', -1);
304
   const int8_t p_val = parser.intval('P', -1);
305
   const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J');
305
   const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J');
306
-  TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index = active_extruder);
306
+  #if ENABLED(HAS_MULTI_HOTEND)
307
+    const uint8_t old_tool_index = active_extruder;
308
+  #endif
307
 
309
 
308
   // Check for commands that require the printer to be homed
310
   // Check for commands that require the printer to be homed
309
   if (may_move) {
311
   if (may_move) {

+ 7
- 3
Marlin/src/feature/caselight.h 파일 보기

34
 class CaseLight {
34
 class CaseLight {
35
 public:
35
 public:
36
   static bool on;
36
   static bool on;
37
-  TERN_(CASELIGHT_USES_BRIGHTNESS, static uint8_t brightness);
37
+  #if ENABLED(CASELIGHT_USES_BRIGHTNESS)
38
+    static uint8_t brightness;
39
+  #endif
38
 
40
 
39
   static bool pin_is_pwm() { return TERN0(NEED_CASE_LIGHT_PIN, PWM_PIN(CASE_LIGHT_PIN)); }
41
   static bool pin_is_pwm() { return TERN0(NEED_CASE_LIGHT_PIN, PWM_PIN(CASE_LIGHT_PIN)); }
40
   static bool has_brightness() { return TERN0(CASELIGHT_USES_BRIGHTNESS, TERN(CASE_LIGHT_USE_NEOPIXEL, true, pin_is_pwm())); }
42
   static bool has_brightness() { return TERN0(CASELIGHT_USES_BRIGHTNESS, TERN(CASE_LIGHT_USE_NEOPIXEL, true, pin_is_pwm())); }
50
   static inline void update_brightness() { update(false); }
52
   static inline void update_brightness() { update(false); }
51
   static inline void update_enabled()    { update(true);  }
53
   static inline void update_enabled()    { update(true);  }
52
 
54
 
53
-private:
54
-  TERN_(CASE_LIGHT_IS_COLOR_LED, static LEDColor color);
55
+  #if ENABLED(CASE_LIGHT_IS_COLOR_LED)
56
+    private:
57
+      static LEDColor color;
58
+  #endif
55
 };
59
 };
56
 
60
 
57
 extern CaseLight caselight;
61
 extern CaseLight caselight;

+ 12
- 4
Marlin/src/feature/joystick.h 파일 보기

32
 class Joystick {
32
 class Joystick {
33
   friend class Temperature;
33
   friend class Temperature;
34
   private:
34
   private:
35
-    TERN_(HAS_JOY_ADC_X, static temp_info_t x);
36
-    TERN_(HAS_JOY_ADC_Y, static temp_info_t y);
37
-    TERN_(HAS_JOY_ADC_Z, static temp_info_t z);
35
+    #if ENABLED(HAS_JOY_ADC_X)
36
+      static temp_info_t x;
37
+    #endif
38
+    #if ENABLED(HAS_JOY_ADC_Y)
39
+      static temp_info_t y;
40
+    #endif
41
+    #if ENABLED(HAS_JOY_ADC_Z)
42
+      static temp_info_t z;
43
+    #endif
38
   public:
44
   public:
39
-    TERN_(JOYSTICK_DEBUG, static void report());
45
+    #if ENABLED(JOYSTICK_DEBUG)
46
+      static void report();
47
+    #endif
40
     static void calculate(xyz_float_t &norm_jog);
48
     static void calculate(xyz_float_t &norm_jog);
41
     static void inject_jog_moves();
49
     static void inject_jog_moves();
42
 };
50
 };

+ 3
- 1
Marlin/src/feature/meatpack.cpp 파일 보기

57
   '\0' // Unused. 0b1111 indicates a literal character
57
   '\0' // Unused. 0b1111 indicates a literal character
58
 };
58
 };
59
 
59
 
60
-TERN_(MP_DEBUG, uint8_t chars_decoded = 0); // Log the first 64 bytes after each reset
60
+#if ENABLED(MP_DEBUG)
61
+  uint8_t chars_decoded = 0;  // Log the first 64 bytes after each reset
62
+#endif
61
 
63
 
62
 void MeatPack::reset_state() {
64
 void MeatPack::reset_state() {
63
   state = 0;
65
   state = 0;

+ 4
- 5
Marlin/src/feature/mixing.h 파일 보기

61
 #define MAX_VTOOLS TERN(HAS_MIXER_SYNC_CHANNEL, 254, 255)
61
 #define MAX_VTOOLS TERN(HAS_MIXER_SYNC_CHANNEL, 254, 255)
62
 static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must be <= " STRINGIFY(MAX_VTOOLS) "!");
62
 static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must be <= " STRINGIFY(MAX_VTOOLS) "!");
63
 
63
 
64
-#define MIXER_BLOCK_FIELD       mixer_comp_t b_color[MIXING_STEPPERS]
65
-#define MIXER_POPULATE_BLOCK()  mixer.populate_block(block->b_color)
66
-#define MIXER_STEPPER_SETUP()   mixer.stepper_setup(current_block->b_color)
67
 #define MIXER_STEPPER_LOOP(VAR) for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++)
64
 #define MIXER_STEPPER_LOOP(VAR) for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++)
68
 
65
 
69
 #if ENABLED(GRADIENT_MIX)
66
 #if ENABLED(GRADIENT_MIX)
73
     mixer_comp_t color[MIXING_STEPPERS];  // The current gradient color
70
     mixer_comp_t color[MIXING_STEPPERS];  // The current gradient color
74
     float start_z, end_z;                 // Region for gradient
71
     float start_z, end_z;                 // Region for gradient
75
     int8_t start_vtool, end_vtool;        // Start and end virtual tools
72
     int8_t start_vtool, end_vtool;        // Start and end virtual tools
76
-    mixer_perc_t start_mix[MIXING_STEPPERS],   // Start and end mixes from those tools
73
+    mixer_perc_t start_mix[MIXING_STEPPERS],  // Start and end mixes from those tools
77
                  end_mix[MIXING_STEPPERS];
74
                  end_mix[MIXING_STEPPERS];
78
-    TERN_(GRADIENT_VTOOL, int8_t vtool_index); // Use this virtual tool number as index
75
+    #if ENABLED(GRADIENT_VTOOL)
76
+      int8_t vtool_index;                 // Use this virtual tool number as index
77
+    #endif
79
   } gradient_t;
78
   } gradient_t;
80
 
79
 
81
 #endif
80
 #endif

+ 30
- 10
Marlin/src/feature/powerloss.h 파일 보기

55
   float zraise;
55
   float zraise;
56
 
56
 
57
   // Repeat information
57
   // Repeat information
58
-  TERN_(GCODE_REPEAT_MARKERS, Repeat stored_repeat);
58
+  #if ENABLED(GCODE_REPEAT_MARKERS)
59
+    Repeat stored_repeat;
60
+  #endif
59
 
61
 
60
-  TERN_(HAS_HOME_OFFSET,    xyz_pos_t home_offset);
61
-  TERN_(HAS_POSITION_SHIFT, xyz_pos_t position_shift);
62
-  TERN_(HAS_MULTI_EXTRUDER, uint8_t active_extruder);
62
+  #if ENABLED(HAS_HOME_OFFSET)
63
+    xyz_pos_t home_offset;
64
+  #endif
65
+  #if ENABLED(HAS_POSITION_SHIFT)
66
+    xyz_pos_t position_shift;
67
+  #endif
68
+  #if ENABLED(HAS_MULTI_EXTRUDER)
69
+    uint8_t active_extruder;
70
+  #endif
63
 
71
 
64
   #if DISABLED(NO_VOLUMETRICS)
72
   #if DISABLED(NO_VOLUMETRICS)
65
     bool volumetric_enabled;
73
     bool volumetric_enabled;
66
     float filament_size[EXTRUDERS];
74
     float filament_size[EXTRUDERS];
67
   #endif
75
   #endif
68
 
76
 
69
-  TERN_(HAS_HOTEND,     celsius_t target_temperature[HOTENDS]);
70
-  TERN_(HAS_HEATED_BED, celsius_t target_temperature_bed);
71
-  TERN_(HAS_FAN,        uint8_t fan_speed[FAN_COUNT]);
77
+  #if ENABLED(HAS_HOTEND)
78
+    celsius_t target_temperature[HOTENDS];
79
+  #endif
80
+  #if ENABLED(HAS_HEATED_BED)
81
+    celsius_t target_temperature_bed;
82
+  #endif
83
+  #if ENABLED(HAS_FAN)
84
+    uint8_t fan_speed[FAN_COUNT];
85
+  #endif
72
 
86
 
73
-  TERN_(HAS_LEVELING, float fade);
87
+  #if ENABLED(HAS_LEVELING)
88
+    float fade;
89
+  #endif
74
 
90
 
75
   #if ENABLED(FWRETRACT)
91
   #if ENABLED(FWRETRACT)
76
     float retract[EXTRUDERS], retract_hop;
92
     float retract[EXTRUDERS], retract_hop;
80
   #if ENABLED(MIXING_EXTRUDER)
96
   #if ENABLED(MIXING_EXTRUDER)
81
     //uint_fast8_t selected_vtool;
97
     //uint_fast8_t selected_vtool;
82
     //mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
98
     //mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
83
-    TERN_(GRADIENT_MIX, gradient_t gradient);
99
+    #if ENABLED(GRADIENT_MIX)
100
+      gradient_t gradient;
101
+    #endif
84
   #endif
102
   #endif
85
 
103
 
86
   // SD Filename and position
104
   // SD Filename and position
97
   struct {
115
   struct {
98
     bool dryrun:1;                // M111 S8
116
     bool dryrun:1;                // M111 S8
99
     bool allow_cold_extrusion:1;  // M302 P1
117
     bool allow_cold_extrusion:1;  // M302 P1
100
-    TERN_(HAS_LEVELING, bool leveling:1);
118
+    #if ENABLED(HAS_LEVELING)
119
+      bool leveling:1;
120
+    #endif
101
   } flag;
121
   } flag;
102
 
122
 
103
   uint8_t valid_foot;
123
   uint8_t valid_foot;

+ 12
- 4
Marlin/src/feature/tmc_util.h 파일 보기

70
     }
70
     }
71
 
71
 
72
     struct {
72
     struct {
73
-      TERN_(HAS_STEALTHCHOP, bool stealthChop_enabled = false);
74
-      TERN_(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0);
75
-      TERN_(USE_SENSORLESS, int16_t homing_thrs = 0);
73
+      #if ENABLED(HAS_STEALTHCHOP)
74
+        bool stealthChop_enabled = false;
75
+      #endif
76
+      #if ENABLED(HYBRID_THRESHOLD)
77
+        uint8_t hybrid_thrs = 0;
78
+      #endif
79
+      #if ENABLED(USE_SENSORLESS)
80
+        int16_t homing_thrs = 0;
81
+      #endif
76
     } stored;
82
     } stored;
77
 };
83
 };
78
 
84
 
363
 
369
 
364
     struct slow_homing_t {
370
     struct slow_homing_t {
365
       xy_ulong_t acceleration;
371
       xy_ulong_t acceleration;
366
-      TERN_(HAS_CLASSIC_JERK, xy_float_t jerk_xy);
372
+      #if ENABLED(HAS_CLASSIC_JERK)
373
+        xy_float_t jerk_xy;
374
+      #endif
367
     };
375
     };
368
   #endif
376
   #endif
369
 
377
 

+ 3
- 1
Marlin/src/gcode/bedlevel/G35.cpp 파일 보기

72
 
72
 
73
   // Disable the leveling matrix before auto-aligning
73
   // Disable the leveling matrix before auto-aligning
74
   #if HAS_LEVELING
74
   #if HAS_LEVELING
75
-    TERN_(RESTORE_LEVELING_AFTER_G35, const bool leveling_was_active = planner.leveling_active);
75
+    #if ENABLED(RESTORE_LEVELING_AFTER_G35)
76
+      const bool leveling_was_active = planner.leveling_active;
77
+    #endif
76
     set_bed_leveling_enabled(false);
78
     set_bed_leveling_enabled(false);
77
   #endif
79
   #endif
78
 
80
 

+ 3
- 1
Marlin/src/gcode/calibrate/G33.cpp 파일 보기

63
 #define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP)
63
 #define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP)
64
 #define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP)
64
 #define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP)
65
 
65
 
66
-TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index = active_extruder);
66
+#if ENABLED(HAS_MULTI_HOTEND)
67
+  const uint8_t old_tool_index = active_extruder;
68
+#endif
67
 
69
 
68
 float lcd_probe_pt(const xy_pos_t &xy);
70
 float lcd_probe_pt(const xy_pos_t &xy);
69
 
71
 

+ 3
- 1
Marlin/src/gcode/calibrate/G34_M422.cpp 파일 보기

130
 
130
 
131
       // Disable the leveling matrix before auto-aligning
131
       // Disable the leveling matrix before auto-aligning
132
       #if HAS_LEVELING
132
       #if HAS_LEVELING
133
-        TERN_(RESTORE_LEVELING_AFTER_G34, const bool leveling_was_active = planner.leveling_active);
133
+        #if ENABLED(RESTORE_LEVELING_AFTER_G34)
134
+          const bool leveling_was_active = planner.leveling_active;
135
+        #endif
134
         set_bed_leveling_enabled(false);
136
         set_bed_leveling_enabled(false);
135
       #endif
137
       #endif
136
 
138
 

+ 252
- 84
Marlin/src/gcode/gcode.h 파일 보기

418
 
418
 
419
 private:
419
 private:
420
 
420
 
421
-  TERN_(MARLIN_DEV_MODE, static void D(const int16_t dcode));
421
+  #if ENABLED(MARLIN_DEV_MODE)
422
+    static void D(const int16_t dcode);
423
+  #endif
422
 
424
 
423
   static void G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move=false));
425
   static void G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move=false));
424
 
426
 
425
-  TERN_(ARC_SUPPORT, static void G2_G3(const bool clockwise));
427
+  #if ENABLED(ARC_SUPPORT)
428
+    static void G2_G3(const bool clockwise);
429
+  #endif
426
 
430
 
427
   static void G4();
431
   static void G4();
428
 
432
 
429
-  TERN_(BEZIER_CURVE_SUPPORT, static void G5());
433
+  #if ENABLED(BEZIER_CURVE_SUPPORT)
434
+    static void G5();
435
+  #endif
430
 
436
 
431
-  TERN_(DIRECT_STEPPING, static void G6());
437
+  #if ENABLED(DIRECT_STEPPING)
438
+    static void G6();
439
+  #endif
432
 
440
 
433
   #if ENABLED(FWRETRACT)
441
   #if ENABLED(FWRETRACT)
434
     static void G10();
442
     static void G10();
435
     static void G11();
443
     static void G11();
436
   #endif
444
   #endif
437
 
445
 
438
-  TERN_(NOZZLE_CLEAN_FEATURE, static void G12());
446
+  #if ENABLED(NOZZLE_CLEAN_FEATURE)
447
+    static void G12();
448
+  #endif
439
 
449
 
440
   #if ENABLED(CNC_WORKSPACE_PLANES)
450
   #if ENABLED(CNC_WORKSPACE_PLANES)
441
     static void G17();
451
     static void G17();
448
     static void G21();
458
     static void G21();
449
   #endif
459
   #endif
450
 
460
 
451
-  TERN_(G26_MESH_VALIDATION, static void G26());
461
+  #if ENABLED(G26_MESH_VALIDATION)
462
+    static void G26();
463
+  #endif
452
 
464
 
453
-  TERN_(NOZZLE_PARK_FEATURE, static void G27());
465
+  #if ENABLED(NOZZLE_PARK_FEATURE)
466
+    static void G27();
467
+  #endif
454
 
468
 
455
   static void G28();
469
   static void G28();
456
 
470
 
474
     #endif
488
     #endif
475
   #endif
489
   #endif
476
 
490
 
477
-  TERN_(DELTA_AUTO_CALIBRATION, static void G33());
491
+  #if ENABLED(DELTA_AUTO_CALIBRATION)
492
+    static void G33();
493
+  #endif
478
 
494
 
479
   #if ANY(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
495
   #if ANY(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
480
     static void G34();
496
     static void G34();
481
   #endif
497
   #endif
482
 
498
 
483
-  TERN_(Z_STEPPER_AUTO_ALIGN, static void M422());
499
+  #if ENABLED(Z_STEPPER_AUTO_ALIGN)
500
+    static void M422();
501
+  #endif
484
 
502
 
485
-  TERN_(ASSISTED_TRAMMING, static void G35());
503
+  #if ENABLED(ASSISTED_TRAMMING)
504
+    static void G35();
505
+  #endif
486
 
506
 
487
-  TERN_(G38_PROBE_TARGET, static void G38(const int8_t subcode));
507
+  #if ENABLED(G38_PROBE_TARGET)
508
+    static void G38(const int8_t subcode);
509
+  #endif
488
 
510
 
489
-  TERN_(HAS_MESH, static void G42());
511
+  #if ENABLED(HAS_MESH)
512
+    static void G42();
513
+  #endif
490
 
514
 
491
   #if ENABLED(CNC_COORDINATE_SYSTEMS)
515
   #if ENABLED(CNC_COORDINATE_SYSTEMS)
492
     static void G53();
516
     static void G53();
498
     static void G59();
522
     static void G59();
499
   #endif
523
   #endif
500
 
524
 
501
-  TERN_(PROBE_TEMP_COMPENSATION, static void G76());
525
+  #if ENABLED(PROBE_TEMP_COMPENSATION)
526
+    static void G76();
527
+  #endif
502
 
528
 
503
   #if SAVED_POSITIONS
529
   #if SAVED_POSITIONS
504
     static void G60();
530
     static void G60();
505
     static void G61();
531
     static void G61();
506
   #endif
532
   #endif
507
 
533
 
508
-  TERN_(GCODE_MOTION_MODES, static void G80());
534
+  #if ENABLED(GCODE_MOTION_MODES)
535
+    static void G80();
536
+  #endif
509
 
537
 
510
   static void G92();
538
   static void G92();
511
 
539
 
512
-  TERN_(CALIBRATION_GCODE, static void G425());
540
+  #if ENABLED(CALIBRATION_GCODE)
541
+    static void G425();
542
+  #endif
513
 
543
 
514
-  TERN_(HAS_RESUME_CONTINUE, static void M0_M1());
544
+  #if ENABLED(HAS_RESUME_CONTINUE)
545
+    static void M0_M1();
546
+  #endif
515
 
547
 
516
   #if HAS_CUTTER
548
   #if HAS_CUTTER
517
     static void M3_M4(const bool is_M4);
549
     static void M3_M4(const bool is_M4);
519
   #endif
551
   #endif
520
 
552
 
521
   #if ENABLED(COOLANT_CONTROL)
553
   #if ENABLED(COOLANT_CONTROL)
522
-    TERN_(COOLANT_MIST, static void M7());
523
-    TERN_(COOLANT_FLOOD, static void M8());
554
+    #if ENABLED(COOLANT_MIST)
555
+      static void M7();
556
+    #endif
557
+    #if ENABLED(COOLANT_FLOOD)
558
+      static void M8();
559
+    #endif
524
     static void M9();
560
     static void M9();
525
   #endif
561
   #endif
526
 
562
 
527
-  TERN_(EXTERNAL_CLOSED_LOOP_CONTROLLER, static void M12());
563
+  #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
564
+    static void M12();
565
+  #endif
528
 
566
 
529
-  TERN_(EXPECTED_PRINTER_CHECK, static void M16());
567
+  #if ENABLED(EXPECTED_PRINTER_CHECK)
568
+    static void M16();
569
+  #endif
530
 
570
 
531
   static void M17();
571
   static void M17();
532
 
572
 
549
   static void M31();
589
   static void M31();
550
 
590
 
551
   #if ENABLED(SDSUPPORT)
591
   #if ENABLED(SDSUPPORT)
552
-    TERN_(HAS_MEDIA_SUBCALLS, static void M32());
553
-    TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33());
592
+    #if ENABLED(HAS_MEDIA_SUBCALLS)
593
+      static void M32();
594
+    #endif
595
+    #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
596
+      static void M33();
597
+    #endif
554
     #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
598
     #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
555
       static void M34();
599
       static void M34();
556
     #endif
600
     #endif
557
   #endif
601
   #endif
558
 
602
 
559
-  TERN_(DIRECT_PIN_CONTROL, static void M42());
560
-  TERN_(PINS_DEBUGGING, static void M43());
603
+  #if ENABLED(DIRECT_PIN_CONTROL)
604
+    static void M42();
605
+  #endif
606
+  #if ENABLED(PINS_DEBUGGING)
607
+    static void M43();
608
+  #endif
561
 
609
 
562
-  TERN_(Z_MIN_PROBE_REPEATABILITY_TEST, static void M48());
610
+  #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
611
+    static void M48();
612
+  #endif
563
 
613
 
564
-  TERN_(LCD_SET_PROGRESS_MANUALLY, static void M73());
614
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
615
+    static void M73();
616
+  #endif
565
 
617
 
566
   static void M75();
618
   static void M75();
567
   static void M76();
619
   static void M76();
568
   static void M77();
620
   static void M77();
569
 
621
 
570
-  TERN_(PRINTCOUNTER, static void M78());
622
+  #if ENABLED(PRINTCOUNTER)
623
+    static void M78();
624
+  #endif
571
 
625
 
572
-  TERN_(PSU_CONTROL, static void M80());
626
+  #if ENABLED(PSU_CONTROL)
627
+    static void M80();
628
+  #endif
573
 
629
 
574
   static void M81();
630
   static void M81();
575
   static void M82();
631
   static void M82();
577
   static void M85();
633
   static void M85();
578
   static void M92();
634
   static void M92();
579
 
635
 
580
-  TERN_(M100_FREE_MEMORY_WATCHER, static void M100());
636
+  #if ENABLED(M100_FREE_MEMORY_WATCHER)
637
+    static void M100();
638
+  #endif
581
 
639
 
582
   #if EXTRUDERS
640
   #if EXTRUDERS
583
     static void M104();
641
     static void M104();
595
     static void M108();
653
     static void M108();
596
     static void M112();
654
     static void M112();
597
     static void M410();
655
     static void M410();
598
-    TERN_(HOST_PROMPT_SUPPORT, static void M876());
656
+    #if ENABLED(HOST_PROMPT_SUPPORT)
657
+      static void M876();
658
+    #endif
599
   #endif
659
   #endif
600
 
660
 
601
   static void M110();
661
   static void M110();
602
   static void M111();
662
   static void M111();
603
 
663
 
604
-  TERN_(HOST_KEEPALIVE_FEATURE, static void M113());
664
+  #if ENABLED(HOST_KEEPALIVE_FEATURE)
665
+    static void M113();
666
+  #endif
605
 
667
 
606
   static void M114();
668
   static void M114();
607
   static void M115();
669
   static void M115();
611
   static void M120();
673
   static void M120();
612
   static void M121();
674
   static void M121();
613
 
675
 
614
-  TERN_(PARK_HEAD_ON_PAUSE, static void M125());
676
+  #if ENABLED(PARK_HEAD_ON_PAUSE)
677
+    static void M125();
678
+  #endif
615
 
679
 
616
   #if ENABLED(BARICUDA)
680
   #if ENABLED(BARICUDA)
617
     #if HAS_HEATER_1
681
     #if HAS_HEATER_1
643
     static void M145();
707
     static void M145();
644
   #endif
708
   #endif
645
 
709
 
646
-  TERN_(TEMPERATURE_UNITS_SUPPORT, static void M149());
710
+  #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
711
+    static void M149();
712
+  #endif
647
 
713
 
648
-  TERN_(HAS_COLOR_LEDS, static void M150());
714
+  #if ENABLED(HAS_COLOR_LEDS)
715
+    static void M150();
716
+  #endif
649
 
717
 
650
   #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)
718
   #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)
651
     static void M155();
719
     static void M155();
654
   #if ENABLED(MIXING_EXTRUDER)
722
   #if ENABLED(MIXING_EXTRUDER)
655
     static void M163();
723
     static void M163();
656
     static void M164();
724
     static void M164();
657
-    TERN_(DIRECT_MIXING_IN_G1, static void M165());
658
-    TERN_(GRADIENT_MIX, static void M166());
725
+    #if ENABLED(DIRECT_MIXING_IN_G1)
726
+      static void M165();
727
+    #endif
728
+    #if ENABLED(GRADIENT_MIX)
729
+      static void M166();
730
+    #endif
659
   #endif
731
   #endif
660
 
732
 
661
   static void M200();
733
   static void M200();
669
   static void M204();
741
   static void M204();
670
   static void M205();
742
   static void M205();
671
 
743
 
672
-  TERN_(HAS_M206_COMMAND, static void M206());
744
+  #if ENABLED(HAS_M206_COMMAND)
745
+    static void M206();
746
+  #endif
673
 
747
 
674
   #if ENABLED(FWRETRACT)
748
   #if ENABLED(FWRETRACT)
675
     static void M207();
749
     static void M207();
676
     static void M208();
750
     static void M208();
677
-    TERN_(FWRETRACT_AUTORETRACT, static void M209());
751
+    #if ENABLED(FWRETRACT_AUTORETRACT)
752
+      static void M209();
753
+    #endif
678
   #endif
754
   #endif
679
 
755
 
680
   static void M211();
756
   static void M211();
681
 
757
 
682
-  TERN_(HAS_MULTI_EXTRUDER, static void M217());
758
+  #if ENABLED(HAS_MULTI_EXTRUDER)
759
+    static void M217();
760
+  #endif
683
 
761
 
684
-  TERN_(HAS_HOTEND_OFFSET, static void M218());
762
+  #if ENABLED(HAS_HOTEND_OFFSET)
763
+    static void M218();
764
+  #endif
685
 
765
 
686
   static void M220();
766
   static void M220();
687
 
767
 
689
     static void M221();
769
     static void M221();
690
   #endif
770
   #endif
691
 
771
 
692
-  TERN_(DIRECT_PIN_CONTROL, static void M226());
772
+  #if ENABLED(DIRECT_PIN_CONTROL)
773
+    static void M226();
774
+  #endif
693
 
775
 
694
-  TERN_(PHOTO_GCODE, static void M240());
776
+  #if ENABLED(PHOTO_GCODE)
777
+    static void M240();
778
+  #endif
695
 
779
 
696
-  TERN_(HAS_LCD_CONTRAST, static void M250());
780
+  #if ENABLED(HAS_LCD_CONTRAST)
781
+    static void M250();
782
+  #endif
697
 
783
 
698
   #if ENABLED(EXPERIMENTAL_I2CBUS)
784
   #if ENABLED(EXPERIMENTAL_I2CBUS)
699
     static void M260();
785
     static void M260();
702
 
788
 
703
   #if HAS_SERVOS
789
   #if HAS_SERVOS
704
     static void M280();
790
     static void M280();
705
-    TERN_(EDITABLE_SERVO_ANGLES, static void M281());
791
+    #if ENABLED(EDITABLE_SERVO_ANGLES)
792
+      static void M281();
793
+    #endif
706
   #endif
794
   #endif
707
 
795
 
708
-  TERN_(BABYSTEPPING, static void M290());
796
+  #if ENABLED(BABYSTEPPING)
797
+    static void M290();
798
+  #endif
709
 
799
 
710
-  TERN_(HAS_BUZZER, static void M300());
800
+  #if ENABLED(HAS_BUZZER)
801
+    static void M300();
802
+  #endif
711
 
803
 
712
-  TERN_(PIDTEMP, static void M301());
804
+  #if ENABLED(PIDTEMP)
805
+    static void M301();
806
+  #endif
713
 
807
 
714
-  TERN_(PREVENT_COLD_EXTRUSION, static void M302());
808
+  #if ENABLED(PREVENT_COLD_EXTRUSION)
809
+    static void M302();
810
+  #endif
715
 
811
 
716
-  TERN_(HAS_PID_HEATING, static void M303());
812
+  #if ENABLED(HAS_PID_HEATING)
813
+    static void M303();
814
+  #endif
717
 
815
 
718
-  TERN_(PIDTEMPBED, static void M304());
816
+  #if ENABLED(PIDTEMPBED)
817
+    static void M304();
818
+  #endif
719
 
819
 
720
-  TERN_(HAS_USER_THERMISTORS, static void M305());
820
+  #if ENABLED(HAS_USER_THERMISTORS)
821
+    static void M305();
822
+  #endif
721
 
823
 
722
-  TERN_(PIDTEMPCHAMBER, static void M309());
824
+  #if ENABLED(PIDTEMPCHAMBER)
825
+    static void M309();
826
+  #endif
723
 
827
 
724
   #if HAS_MICROSTEPS
828
   #if HAS_MICROSTEPS
725
     static void M350();
829
     static void M350();
726
     static void M351();
830
     static void M351();
727
   #endif
831
   #endif
728
 
832
 
729
-  TERN_(CASE_LIGHT_ENABLE, static void M355());
833
+  #if ENABLED(CASE_LIGHT_ENABLE)
834
+    static void M355();
835
+  #endif
730
 
836
 
731
-  TERN_(REPETIER_GCODE_M360, static void M360());
837
+  #if ENABLED(REPETIER_GCODE_M360)
838
+    static void M360();
839
+  #endif
732
 
840
 
733
   #if ENABLED(MORGAN_SCARA)
841
   #if ENABLED(MORGAN_SCARA)
734
     static bool M360();
842
     static bool M360();
750
     static void M402();
858
     static void M402();
751
   #endif
859
   #endif
752
 
860
 
753
-  TERN_(HAS_PRUSA_MMU2, static void M403());
861
+  #if ENABLED(HAS_PRUSA_MMU2)
862
+    static void M403();
863
+  #endif
754
 
864
 
755
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
865
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
756
     static void M404();
866
     static void M404();
759
     static void M407();
869
     static void M407();
760
   #endif
870
   #endif
761
 
871
 
762
-  TERN_(HAS_FILAMENT_SENSOR, static void M412());
872
+  #if ENABLED(HAS_FILAMENT_SENSOR)
873
+    static void M412();
874
+  #endif
763
 
875
 
764
-  TERN_(HAS_MULTI_LANGUAGE, static void M414());
876
+  #if ENABLED(HAS_MULTI_LANGUAGE)
877
+    static void M414();
878
+  #endif
765
 
879
 
766
   #if HAS_LEVELING
880
   #if HAS_LEVELING
767
     static void M420();
881
     static void M420();
768
     static void M421();
882
     static void M421();
769
   #endif
883
   #endif
770
 
884
 
771
-  TERN_(BACKLASH_GCODE, static void M425());
885
+  #if ENABLED(BACKLASH_GCODE)
886
+    static void M425();
887
+  #endif
772
 
888
 
773
-  TERN_(HAS_M206_COMMAND, static void M428());
889
+  #if ENABLED(HAS_M206_COMMAND)
890
+    static void M428();
891
+  #endif
774
 
892
 
775
-  TERN_(HAS_POWER_MONITOR, static void M430());
893
+  #if ENABLED(HAS_POWER_MONITOR)
894
+    static void M430();
895
+  #endif
776
 
896
 
777
-  TERN_(CANCEL_OBJECTS, static void M486());
897
+  #if ENABLED(CANCEL_OBJECTS)
898
+    static void M486();
899
+  #endif
778
 
900
 
779
   static void M500();
901
   static void M500();
780
   static void M501();
902
   static void M501();
782
   #if DISABLED(DISABLE_M503)
904
   #if DISABLED(DISABLE_M503)
783
     static void M503();
905
     static void M503();
784
   #endif
906
   #endif
785
-  TERN_(EEPROM_SETTINGS, static void M504());
907
+  #if ENABLED(EEPROM_SETTINGS)
908
+    static void M504();
909
+  #endif
786
 
910
 
787
   #if ENABLED(PASSWORD_FEATURE)
911
   #if ENABLED(PASSWORD_FEATURE)
788
     static void M510();
912
     static void M510();
789
-    TERN_(PASSWORD_UNLOCK_GCODE, static void M511());
790
-    TERN_(PASSWORD_CHANGE_GCODE, static void M512());
913
+    #if ENABLED(PASSWORD_UNLOCK_GCODE)
914
+      static void M511();
915
+    #endif
916
+    #if ENABLED(PASSWORD_CHANGE_GCODE)
917
+      static void M512();
918
+    #endif
791
   #endif
919
   #endif
792
 
920
 
793
-  TERN_(SDSUPPORT, static void M524());
921
+  #if ENABLED(SDSUPPORT)
922
+    static void M524();
923
+  #endif
794
 
924
 
795
-  TERN_(SD_ABORT_ON_ENDSTOP_HIT, static void M540());
925
+  #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
926
+    static void M540();
927
+  #endif
796
 
928
 
797
   #if HAS_ETHERNET
929
   #if HAS_ETHERNET
798
     static void M552();
930
     static void M552();
800
     static void M554();
932
     static void M554();
801
   #endif
933
   #endif
802
 
934
 
803
-  TERN_(BAUD_RATE_GCODE, static void M575());
935
+  #if ENABLED(BAUD_RATE_GCODE)
936
+    static void M575();
937
+  #endif
804
 
938
 
805
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
939
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
806
     static void M600();
940
     static void M600();
807
     static void M603();
941
     static void M603();
808
   #endif
942
   #endif
809
 
943
 
810
-  TERN_(HAS_DUPLICATION_MODE, static void M605());
944
+  #if ENABLED(HAS_DUPLICATION_MODE)
945
+    static void M605();
946
+  #endif
811
 
947
 
812
-  TERN_(IS_KINEMATIC, static void M665());
948
+  #if ENABLED(IS_KINEMATIC)
949
+    static void M665();
950
+  #endif
813
 
951
 
814
   #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS
952
   #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS
815
     static void M666();
953
     static void M666();
824
     static void M702();
962
     static void M702();
825
   #endif
963
   #endif
826
 
964
 
827
-  TERN_(GCODE_REPEAT_MARKERS, static void M808());
965
+  #if ENABLED(GCODE_REPEAT_MARKERS)
966
+    static void M808();
967
+  #endif
828
 
968
 
829
-  TERN_(GCODE_MACROS, static void M810_819());
969
+  #if ENABLED(GCODE_MACROS)
970
+    static void M810_819();
971
+  #endif
830
 
972
 
831
-  TERN_(HAS_BED_PROBE, static void M851());
973
+  #if ENABLED(HAS_BED_PROBE)
974
+    static void M851();
975
+  #endif
832
 
976
 
833
-  TERN_(SKEW_CORRECTION_GCODE, static void M852());
977
+  #if ENABLED(SKEW_CORRECTION_GCODE)
978
+    static void M852();
979
+  #endif
834
 
980
 
835
   #if ENABLED(I2C_POSITION_ENCODERS)
981
   #if ENABLED(I2C_POSITION_ENCODERS)
836
     FORCE_INLINE static void M860() { I2CPEM.M860(); }
982
     FORCE_INLINE static void M860() { I2CPEM.M860(); }
850
     static void M871();
996
     static void M871();
851
   #endif
997
   #endif
852
 
998
 
853
-  TERN_(LIN_ADVANCE, static void M900());
999
+  #if ENABLED(LIN_ADVANCE)
1000
+    static void M900();
1001
+  #endif
854
 
1002
 
855
   #if HAS_TRINAMIC_CONFIG
1003
   #if HAS_TRINAMIC_CONFIG
856
     static void M122();
1004
     static void M122();
857
     static void M906();
1005
     static void M906();
858
-    TERN_(HAS_STEALTHCHOP, static void M569());
1006
+    #if ENABLED(HAS_STEALTHCHOP)
1007
+      static void M569();
1008
+    #endif
859
     #if ENABLED(MONITOR_DRIVER_STATUS)
1009
     #if ENABLED(MONITOR_DRIVER_STATUS)
860
       static void M911();
1010
       static void M911();
861
       static void M912();
1011
       static void M912();
862
     #endif
1012
     #endif
863
-    TERN_(HYBRID_THRESHOLD, static void M913());
864
-    TERN_(USE_SENSORLESS, static void M914());
1013
+    #if ENABLED(HYBRID_THRESHOLD)
1014
+      static void M913();
1015
+    #endif
1016
+    #if ENABLED(USE_SENSORLESS)
1017
+      static void M914();
1018
+    #endif
865
   #endif
1019
   #endif
866
 
1020
 
867
   #if HAS_L64XX
1021
   #if HAS_L64XX
883
     #endif
1037
     #endif
884
   #endif
1038
   #endif
885
 
1039
 
886
-  TERN_(SDSUPPORT, static void M928());
1040
+  #if ENABLED(SDSUPPORT)
1041
+    static void M928();
1042
+  #endif
887
 
1043
 
888
-  TERN_(MAGNETIC_PARKING_EXTRUDER, static void M951());
1044
+  #if ENABLED(MAGNETIC_PARKING_EXTRUDER)
1045
+    static void M951();
1046
+  #endif
889
 
1047
 
890
-  TERN_(TOUCH_SCREEN_CALIBRATION, static void M995());
1048
+  #if ENABLED(TOUCH_SCREEN_CALIBRATION)
1049
+    static void M995();
1050
+  #endif
891
 
1051
 
892
   #if BOTH(HAS_SPI_FLASH, SDSUPPORT)
1052
   #if BOTH(HAS_SPI_FLASH, SDSUPPORT)
893
     static void M993();
1053
     static void M993();
894
     static void M994();
1054
     static void M994();
895
   #endif
1055
   #endif
896
 
1056
 
897
-  TERN_(PLATFORM_M997_SUPPORT, static void M997());
1057
+  #if ENABLED(PLATFORM_M997_SUPPORT)
1058
+    static void M997();
1059
+  #endif
898
 
1060
 
899
   static void M999();
1061
   static void M999();
900
 
1062
 
903
     static void M1000();
1065
     static void M1000();
904
   #endif
1066
   #endif
905
 
1067
 
906
-  TERN_(SDSUPPORT, static void M1001());
1068
+  #if ENABLED(SDSUPPORT)
1069
+    static void M1001();
1070
+  #endif
907
 
1071
 
908
-  TERN_(MAX7219_GCODE, static void M7219());
1072
+  #if ENABLED(MAX7219_GCODE)
1073
+    static void M7219();
1074
+  #endif
909
 
1075
 
910
-  TERN_(CONTROLLER_FAN_EDITABLE, static void M710());
1076
+  #if ENABLED(CONTROLLER_FAN_EDITABLE)
1077
+    static void M710();
1078
+  #endif
911
 
1079
 
912
   static void T(const int8_t tool_index);
1080
   static void T(const int8_t tool_index);
913
 
1081
 

+ 8
- 6
Marlin/src/gcode/queue.h 파일 보기

40
      * M110 N<int> sets the current line number.
40
      * M110 N<int> sets the current line number.
41
      */
41
      */
42
     long last_N;
42
     long last_N;
43
-    int count;                        //!< Number of characters read in the current line of serial input
44
-    char line_buffer[MAX_CMD_SIZE];   //!< The current line accumulator
45
-    uint8_t input_state;              //!< The input state
43
+    int count;                      //!< Number of characters read in the current line of serial input
44
+    char line_buffer[MAX_CMD_SIZE]; //!< The current line accumulator
45
+    uint8_t input_state;            //!< The input state
46
   };
46
   };
47
 
47
 
48
   static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port
48
   static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port
57
    * command and hands off execution to individual handler functions.
57
    * command and hands off execution to individual handler functions.
58
    */
58
    */
59
   struct CommandLine {
59
   struct CommandLine {
60
-    char buffer[MAX_CMD_SIZE];                    //!< The command buffer
61
-    bool skip_ok;                                 //!< Skip sending ok when command is processed?
62
-    TERN_(HAS_MULTI_SERIAL, serial_index_t port); //!< Serial port the command was received on
60
+    char buffer[MAX_CMD_SIZE];      //!< The command buffer
61
+    bool skip_ok;                   //!< Skip sending ok when command is processed?
62
+    #if ENABLED(HAS_MULTI_SERIAL)
63
+      serial_index_t port;          //!< Serial port the command was received on
64
+    #endif
63
   };
65
   };
64
 
66
 
65
   /**
67
   /**

+ 3
- 1
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp 파일 보기

536
 static struct {
536
 static struct {
537
   bool E1_show_target  : 1;
537
   bool E1_show_target  : 1;
538
   bool E2_show_target  : 1;
538
   bool E2_show_target  : 1;
539
-  TERN_(HAS_HEATED_BED, bool bed_show_target : 1);
539
+  #if ENABLED(HAS_HEATED_BED)
540
+    bool bed_show_target : 1;
541
+  #endif
540
 } display_state = {
542
 } display_state = {
541
   true, true, TERN_(HAS_HEATED_BED, true)
543
   true, true, TERN_(HAS_HEATED_BED, true)
542
 };
544
 };

+ 6
- 2
Marlin/src/lcd/dwin/e3v2/dwin.cpp 파일 보기

180
 static uint16_t _remain_time = 0;
180
 static uint16_t _remain_time = 0;
181
 
181
 
182
 #if ENABLED(PAUSE_HEAT)
182
 #if ENABLED(PAUSE_HEAT)
183
-  TERN_(HAS_HOTEND, uint16_t resume_hotend_temp = 0);
184
-  TERN_(HAS_HEATED_BED, uint16_t resume_bed_temp = 0);
183
+  #if ENABLED(HAS_HOTEND)
184
+    uint16_t resume_hotend_temp = 0;
185
+  #endif
186
+  #if ENABLED(HAS_HEATED_BED)
187
+    uint16_t resume_bed_temp = 0;
188
+  #endif
185
 #endif
189
 #endif
186
 
190
 
187
 #if HAS_ZOFFSET_ITEM
191
 #if HAS_ZOFFSET_ITEM

+ 18
- 6
Marlin/src/lcd/dwin/e3v2/dwin.h 파일 보기

234
 extern millis_t dwin_heat_time;
234
 extern millis_t dwin_heat_time;
235
 
235
 
236
 typedef struct {
236
 typedef struct {
237
-  TERN_(HAS_HOTEND,     celsius_t E_Temp    = 0);
238
-  TERN_(HAS_HEATED_BED, celsius_t Bed_Temp  = 0);
239
-  TERN_(HAS_FAN,        int16_t Fan_speed = 0);
237
+  #if ENABLED(HAS_HOTEND)
238
+    celsius_t E_Temp = 0;
239
+  #endif
240
+  #if ENABLED(HAS_HEATED_BED)
241
+    celsius_t Bed_Temp = 0;
242
+  #endif
243
+  #if ENABLED(HAS_FAN)
244
+    int16_t Fan_speed = 0;
245
+  #endif
240
   int16_t print_speed     = 100;
246
   int16_t print_speed     = 100;
241
   float Max_Feedspeed     = 0;
247
   float Max_Feedspeed     = 0;
242
   float Max_Acceleration  = 0;
248
   float Max_Acceleration  = 0;
312
 
318
 
313
 void HMI_Zoffset();
319
 void HMI_Zoffset();
314
 
320
 
315
-TERN_(HAS_HOTEND,     void HMI_ETemp());
316
-TERN_(HAS_HEATED_BED, void HMI_BedTemp());
317
-TERN_(HAS_FAN,        void HMI_FanSpeed());
321
+#if ENABLED(HAS_HOTEND)
322
+  void HMI_ETemp();
323
+#endif
324
+#if ENABLED(HAS_HEATED_BED)
325
+  void HMI_BedTemp();
326
+#endif
327
+#if ENABLED(HAS_FAN)
328
+  void HMI_FanSpeed();
329
+#endif
318
 
330
 
319
 void HMI_PrintSpeed();
331
 void HMI_PrintSpeed();
320
 
332
 

+ 3
- 1
Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp 파일 보기

624
     DEBUG_ECHOLNPGM("HandlePreheat");
624
     DEBUG_ECHOLNPGM("HandlePreheat");
625
 
625
 
626
     uint8_t e_temp = 0;
626
     uint8_t e_temp = 0;
627
-    TERN_(HAS_HEATED_BED, uint8_t bed_temp = 0);
627
+    #if ENABLED(HAS_HEATED_BED)
628
+      uint8_t bed_temp = 0;
629
+    #endif
628
     const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
630
     const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
629
     switch (preheat_option) {
631
     switch (preheat_option) {
630
       default:
632
       default:

+ 3
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp 파일 보기

49
 static lv_obj_t *bar1, *bar1ValueText;
49
 static lv_obj_t *bar1, *bar1ValueText;
50
 static lv_obj_t *buttonPause, *buttonOperat, *buttonStop;
50
 static lv_obj_t *buttonPause, *buttonOperat, *buttonStop;
51
 
51
 
52
-TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2);
52
+#if ENABLED(HAS_MULTI_EXTRUDER)
53
+  static lv_obj_t *labelExt2;
54
+#endif
53
 
55
 
54
 #if HAS_HEATED_BED
56
 #if HAS_HEATED_BED
55
   static lv_obj_t* labelBed;
57
   static lv_obj_t* labelBed;

+ 56
- 20
Marlin/src/lcd/extui/ui_api.cpp 파일 보기

103
 namespace ExtUI {
103
 namespace ExtUI {
104
   static struct {
104
   static struct {
105
     uint8_t printer_killed : 1;
105
     uint8_t printer_killed : 1;
106
-    TERN_(JOYSTICK, uint8_t jogging : 1);
107
-    TERN_(SDSUPPORT, uint8_t was_sd_printing : 1);
106
+    #if ENABLED(JOYSTICK)
107
+      uint8_t jogging : 1;
108
+    #endif
109
+    #if ENABLED(SDSUPPORT)
110
+      uint8_t was_sd_printing : 1;
111
+    #endif
108
   } flags;
112
   } flags;
109
 
113
 
110
   #ifdef __SAM3X8E__
114
   #ifdef __SAM3X8E__
175
         #if HAS_HEATED_BED
179
         #if HAS_HEATED_BED
176
           case BED: thermalManager.reset_bed_idle_timer(); return;
180
           case BED: thermalManager.reset_bed_idle_timer(); return;
177
         #endif
181
         #endif
178
-        TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return); // Chamber has no idle timer
179
-        TERN_(HAS_COOLER, case COOLER: return); // Cooler has no idle timer
182
+        #if ENABLED(HAS_HEATED_CHAMBER)
183
+          case CHAMBER: return; // Chamber has no idle timer
184
+        #endif
185
+        #if ENABLED(HAS_COOLER)
186
+          case COOLER: return;  // Cooler has no idle timer
187
+        #endif
180
         default:
188
         default:
181
           TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0));
189
           TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0));
182
           break;
190
           break;
234
   bool isHeaterIdle(const heater_t heater) {
242
   bool isHeaterIdle(const heater_t heater) {
235
     #if HEATER_IDLE_HANDLER
243
     #if HEATER_IDLE_HANDLER
236
       switch (heater) {
244
       switch (heater) {
237
-        TERN_(HAS_HEATED_BED, case BED: return thermalManager.heater_idle[thermalManager.IDLE_INDEX_BED].timed_out);
238
-        TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return false); // Chamber has no idle timer
245
+        #if ENABLED(HAS_HEATED_BED)
246
+          case BED: return thermalManager.heater_idle[thermalManager.IDLE_INDEX_BED].timed_out;
247
+        #endif
248
+        #if ENABLED(HAS_HEATED_CHAMBER)
249
+          case CHAMBER: return false; // Chamber has no idle timer
250
+        #endif
239
         default:
251
         default:
240
           return TERN0(HAS_HOTEND, thermalManager.heater_idle[heater - H0].timed_out);
252
           return TERN0(HAS_HOTEND, thermalManager.heater_idle[heater - H0].timed_out);
241
       }
253
       }
253
 
265
 
254
   float getActualTemp_celsius(const heater_t heater) {
266
   float getActualTemp_celsius(const heater_t heater) {
255
     switch (heater) {
267
     switch (heater) {
256
-      TERN_(HAS_HEATED_BED, case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed()));
257
-      TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber()));
268
+      #if ENABLED(HAS_HEATED_BED)
269
+        case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed());
270
+      #endif
271
+      #if ENABLED(HAS_HEATED_CHAMBER)
272
+        case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber());
273
+      #endif
258
       default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0));
274
       default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0));
259
     }
275
     }
260
   }
276
   }
265
 
281
 
266
   float getTargetTemp_celsius(const heater_t heater) {
282
   float getTargetTemp_celsius(const heater_t heater) {
267
     switch (heater) {
283
     switch (heater) {
268
-      TERN_(HAS_HEATED_BED, case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed()));
269
-      TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber()));
284
+      #if ENABLED(HAS_HEATED_BED)
285
+        case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed());
286
+      #endif
287
+      #if ENABLED(HAS_HEATED_CHAMBER)
288
+        case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber());
289
+      #endif
270
       default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0));
290
       default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0));
271
     }
291
     }
272
   }
292
   }
294
   }
314
   }
295
 
315
 
296
   float getAxisPosition_mm(const axis_t axis) {
316
   float getAxisPosition_mm(const axis_t axis) {
297
-    return TERN_(JOYSTICK, flags.jogging ? destination[axis] :) current_position[axis];
317
+    return TERN0(JOYSTICK, flags.jogging) ? destination[axis] : current_position[axis];
298
   }
318
   }
299
 
319
 
300
   float getAxisPosition_mm(const extruder_t extruder) {
320
   float getAxisPosition_mm(const extruder_t extruder) {
301
     const extruder_t old_tool = getActiveTool();
321
     const extruder_t old_tool = getActiveTool();
302
     setActiveTool(extruder, true);
322
     setActiveTool(extruder, true);
303
-    const float epos = TERN_(JOYSTICK, flags.jogging ? destination.e :) current_position.e;
323
+    const float epos = TERN0(JOYSTICK, flags.jogging) ? destination.e : current_position.e;
304
     setActiveTool(old_tool, true);
324
     setActiveTool(old_tool, true);
305
     return epos;
325
     return epos;
306
   }
326
   }
491
 
511
 
492
     int getTMCBumpSensitivity(const axis_t axis) {
512
     int getTMCBumpSensitivity(const axis_t axis) {
493
       switch (axis) {
513
       switch (axis) {
494
-        TERN_(X_SENSORLESS,  case X:  return stepperX.homing_threshold());
495
-        TERN_(X2_SENSORLESS, case X2: return stepperX2.homing_threshold());
496
-        TERN_(Y_SENSORLESS,  case Y:  return stepperY.homing_threshold());
497
-        TERN_(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold());
498
-        TERN_(Z_SENSORLESS,  case Z:  return stepperZ.homing_threshold());
499
-        TERN_(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold());
500
-        TERN_(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold());
501
-        TERN_(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold());
514
+        #if ENABLED(X_SENSORLESS)
515
+          case X:  return stepperX.homing_threshold();
516
+        #endif
517
+        #if ENABLED(X2_SENSORLESS)
518
+          case X2: return stepperX2.homing_threshold();
519
+        #endif
520
+        #if ENABLED(Y_SENSORLESS)
521
+          case Y:  return stepperY.homing_threshold();
522
+        #endif
523
+        #if ENABLED(Y2_SENSORLESS)
524
+          case Y2: return stepperY2.homing_threshold();
525
+        #endif
526
+        #if ENABLED(Z_SENSORLESS)
527
+          case Z:  return stepperZ.homing_threshold();
528
+        #endif
529
+        #if ENABLED(Z2_SENSORLESS)
530
+          case Z2: return stepperZ2.homing_threshold();
531
+        #endif
532
+        #if ENABLED(Z3_SENSORLESS)
533
+          case Z3: return stepperZ3.homing_threshold();
534
+        #endif
535
+        #if ENABLED(Z4_SENSORLESS)
536
+          case Z4: return stepperZ4.homing_threshold();
537
+        #endif
502
         default: return 0;
538
         default: return 0;
503
       }
539
       }
504
     }
540
     }

+ 3
- 1
Marlin/src/lcd/marlinui.cpp 파일 보기

688
     xyze_pos_t ManualMove::all_axes_destination = { 0 };
688
     xyze_pos_t ManualMove::all_axes_destination = { 0 };
689
     bool ManualMove::processing = false;
689
     bool ManualMove::processing = false;
690
   #endif
690
   #endif
691
-  TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0);
691
+  #if ENABLED(MULTI_MANUAL)
692
+    int8_t ManualMove::e_index = 0;
693
+  #endif
692
   AxisEnum ManualMove::axis = NO_AXIS;
694
   AxisEnum ManualMove::axis = NO_AXIS;
693
 
695
 
694
   /**
696
   /**

+ 15
- 5
Marlin/src/lcd/marlinui.h 파일 보기

105
 
105
 
106
 #if PREHEAT_COUNT
106
 #if PREHEAT_COUNT
107
   typedef struct {
107
   typedef struct {
108
-    TERN_(HAS_HOTEND,     celsius_t hotend_temp);
109
-    TERN_(HAS_HEATED_BED, celsius_t bed_temp   );
110
-    TERN_(HAS_FAN,        uint16_t  fan_speed  );
108
+    #if ENABLED(HAS_HOTEND)
109
+      celsius_t hotend_temp;
110
+    #endif
111
+    #if ENABLED(HAS_HEATED_BED)
112
+      celsius_t bed_temp;
113
+    #endif
114
+    #if ENABLED(HAS_FAN)
115
+      uint16_t fan_speed;
116
+    #endif
111
   } preheat_t;
117
   } preheat_t;
112
 #endif
118
 #endif
113
 
119
 
123
       static int8_t constexpr e_index = 0;
129
       static int8_t constexpr e_index = 0;
124
     #endif
130
     #endif
125
     static millis_t start_time;
131
     static millis_t start_time;
126
-    TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination);
132
+    #if ENABLED(IS_KINEMATIC)
133
+      static xyze_pos_t all_axes_destination;
134
+    #endif
127
   public:
135
   public:
128
     static float menu_scale;
136
     static float menu_scale;
129
-    TERN_(IS_KINEMATIC, static float offset);
137
+    #if ENABLED(IS_KINEMATIC)
138
+      static float offset;
139
+    #endif
130
     template <typename T>
140
     template <typename T>
131
     void set_destination(const T& dest) {
141
     void set_destination(const T& dest) {
132
       #if IS_KINEMATIC
142
       #if IS_KINEMATIC

+ 12
- 4
Marlin/src/lcd/menu/game/game.h 파일 보기

53
 
53
 
54
 // Pool game data to save SRAM
54
 // Pool game data to save SRAM
55
 union MarlinGameData {
55
 union MarlinGameData {
56
-  TERN_(MARLIN_BRICKOUT, brickout_data_t brickout);
57
-  TERN_(MARLIN_INVADERS, invaders_data_t invaders);
58
-  TERN_(MARLIN_SNAKE, snake_data_t snake);
59
-  TERN_(MARLIN_MAZE, maze_data_t maze);
56
+  #if ENABLED(MARLIN_BRICKOUT)
57
+    brickout_data_t brickout;
58
+  #endif
59
+  #if ENABLED(MARLIN_INVADERS)
60
+    invaders_data_t invaders;
61
+  #endif
62
+  #if ENABLED(MARLIN_SNAKE)
63
+    snake_data_t snake;
64
+  #endif
65
+  #if ENABLED(MARLIN_MAZE)
66
+    maze_data_t maze;
67
+  #endif
60
 };
68
 };
61
 
69
 
62
 extern MarlinGameData marlin_game_data;
70
 extern MarlinGameData marlin_game_data;

+ 3
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp 파일 보기

119
 }
119
 }
120
 
120
 
121
 void menu_delta_calibrate() {
121
 void menu_delta_calibrate() {
122
-  TERN_(DELTA_CALIBRATION_MENU, const bool all_homed = all_axes_homed()); // Acquire ahead of loop
122
+  #if ENABLED(DELTA_CALIBRATION_MENU)
123
+    const bool all_homed = all_axes_homed();  // Acquire ahead of loop
124
+  #endif
123
 
125
 
124
   START_MENU();
126
   START_MENU();
125
   BACK_ITEM(MSG_MAIN);
127
   BACK_ITEM(MSG_MAIN);

+ 3
- 1
Marlin/src/lcd/menu/menu_probe_offset.cpp 파일 보기

42
 // Global storage
42
 // Global storage
43
 float z_offset_backup, calculated_z_offset, z_offset_ref;
43
 float z_offset_backup, calculated_z_offset, z_offset_ref;
44
 
44
 
45
-TERN_(HAS_LEVELING, bool leveling_was_active);
45
+#if ENABLED(HAS_LEVELING)
46
+  bool leveling_was_active;
47
+#endif
46
 
48
 
47
 inline void z_clearance_move() {
49
 inline void z_clearance_move() {
48
   do_z_clearance(
50
   do_z_clearance(

+ 9
- 3
Marlin/src/libs/nozzle.cpp 파일 보기

46
    * @param strokes number of strokes to execute
46
    * @param strokes number of strokes to execute
47
    */
47
    */
48
   void Nozzle::stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) {
48
   void Nozzle::stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) {
49
-    TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t oldpos = current_position);
49
+    #if ENABLED(NOZZLE_CLEAN_GOBACK)
50
+      const xyz_pos_t oldpos = current_position;
51
+    #endif
50
 
52
 
51
     // Move to the starting point
53
     // Move to the starting point
52
     #if ENABLED(NOZZLE_CLEAN_NO_Z)
54
     #if ENABLED(NOZZLE_CLEAN_NO_Z)
86
     const xy_pos_t diff = end - start;
88
     const xy_pos_t diff = end - start;
87
     if (!diff.x || !diff.y) return;
89
     if (!diff.x || !diff.y) return;
88
 
90
 
89
-    TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t back = current_position);
91
+    #if ENABLED(NOZZLE_CLEAN_GOBACK)
92
+      const xyz_pos_t back = current_position;
93
+    #endif
90
 
94
 
91
     #if ENABLED(NOZZLE_CLEAN_NO_Z)
95
     #if ENABLED(NOZZLE_CLEAN_NO_Z)
92
       do_blocking_move_to_xy(start);
96
       do_blocking_move_to_xy(start);
129
   void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) {
133
   void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) {
130
     if (strokes == 0) return;
134
     if (strokes == 0) return;
131
 
135
 
132
-    TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t back = current_position);
136
+    #if ENABLED(NOZZLE_CLEAN_GOBACK)
137
+      const xyz_pos_t back = current_position;
138
+    #endif
133
     TERN(NOZZLE_CLEAN_NO_Z, do_blocking_move_to_xy, do_blocking_move_to)(start);
139
     TERN(NOZZLE_CLEAN_NO_Z, do_blocking_move_to_xy, do_blocking_move_to)(start);
134
 
140
 
135
     LOOP_L_N(s, strokes)
141
     LOOP_L_N(s, strokes)

+ 9
- 3
Marlin/src/module/endstops.h 파일 보기

46
   public:
46
   public:
47
     #if HAS_EXTRA_ENDSTOPS
47
     #if HAS_EXTRA_ENDSTOPS
48
       typedef uint16_t esbits_t;
48
       typedef uint16_t esbits_t;
49
-      TERN_(X_DUAL_ENDSTOPS, static float x2_endstop_adj);
50
-      TERN_(Y_DUAL_ENDSTOPS, static float y2_endstop_adj);
51
-      TERN_(Z_MULTI_ENDSTOPS, static float z2_endstop_adj);
49
+      #if ENABLED(X_DUAL_ENDSTOPS)
50
+        static float x2_endstop_adj;
51
+      #endif
52
+      #if ENABLED(Y_DUAL_ENDSTOPS)
53
+        static float y2_endstop_adj;
54
+      #endif
55
+      #if ENABLED(Z_MULTI_ENDSTOPS)
56
+        static float z2_endstop_adj;
57
+      #endif
52
       #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
58
       #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
53
         static float z3_endstop_adj;
59
         static float z3_endstop_adj;
54
       #endif
60
       #endif

+ 1
- 3
Marlin/src/module/planner.cpp 파일 보기

2019
   // Bail if this is a zero-length block
2019
   // Bail if this is a zero-length block
2020
   if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false;
2020
   if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false;
2021
 
2021
 
2022
-  #if ENABLED(MIXING_EXTRUDER)
2023
-    MIXER_POPULATE_BLOCK();
2024
-  #endif
2022
+  TERN_(MIXING_EXTRUDER, mixer.populate_block(block->b_color))
2025
 
2023
 
2026
   TERN_(HAS_CUTTER, block->cutter_power = cutter.power);
2024
   TERN_(HAS_CUTTER, block->cutter_power = cutter.power);
2027
 
2025
 

+ 3
- 1
Marlin/src/module/planner.h 파일 보기

170
     static constexpr uint8_t extruder = 0;
170
     static constexpr uint8_t extruder = 0;
171
   #endif
171
   #endif
172
 
172
 
173
-  TERN_(MIXING_EXTRUDER, MIXER_BLOCK_FIELD); // Normalized color for the mixing steppers
173
+  #if ENABLED(MIXING_EXTRUDER)
174
+    mixer_comp_t b_color[MIXING_STEPPERS];  // Normalized color for the mixing steppers
175
+  #endif
174
 
176
 
175
   // Settings for the trapezoid generator
177
   // Settings for the trapezoid generator
176
   uint32_t accelerate_until,                // The index of the step event on which to stop acceleration
178
   uint32_t accelerate_until,                // The index of the step event on which to stop acceleration

+ 3
- 1
Marlin/src/module/servo.cpp 파일 보기

32
 
32
 
33
 HAL_SERVO_LIB servo[NUM_SERVOS];
33
 HAL_SERVO_LIB servo[NUM_SERVOS];
34
 
34
 
35
-TERN_(EDITABLE_SERVO_ANGLES, uint16_t servo_angles[NUM_SERVOS][2]);
35
+#if ENABLED(EDITABLE_SERVO_ANGLES)
36
+  uint16_t servo_angles[NUM_SERVOS][2];
37
+#endif
36
 
38
 
37
 void servo_init() {
39
 void servo_init() {
38
   #if NUM_SERVOS >= 1 && HAS_SERVO_0
40
   #if NUM_SERVOS >= 1 && HAS_SERVO_0

+ 1
- 3
Marlin/src/module/stepper.cpp 파일 보기

2130
       accelerate_until = current_block->accelerate_until << oversampling;
2130
       accelerate_until = current_block->accelerate_until << oversampling;
2131
       decelerate_after = current_block->decelerate_after << oversampling;
2131
       decelerate_after = current_block->decelerate_after << oversampling;
2132
 
2132
 
2133
-      #if ENABLED(MIXING_EXTRUDER)
2134
-        MIXER_STEPPER_SETUP();
2135
-      #endif
2133
+      TERN_(MIXING_EXTRUDER, mixer.stepper_setup(current_block->b_color))
2136
 
2134
 
2137
       TERN_(HAS_MULTI_EXTRUDER, stepper_extruder = current_block->extruder);
2135
       TERN_(HAS_MULTI_EXTRUDER, stepper_extruder = current_block->extruder);
2138
 
2136
 

+ 63
- 21
Marlin/src/module/temperature.h 파일 보기

326
       static const celsius_t hotend_maxtemp[HOTENDS];
326
       static const celsius_t hotend_maxtemp[HOTENDS];
327
       FORCE_INLINE static celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); }
327
       FORCE_INLINE static celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); }
328
     #endif
328
     #endif
329
-    TERN_(HAS_HEATED_BED, static bed_info_t temp_bed);
330
-    TERN_(HAS_TEMP_PROBE, static probe_info_t temp_probe);
331
-    TERN_(HAS_TEMP_CHAMBER, static chamber_info_t temp_chamber);
332
-    TERN_(HAS_TEMP_COOLER, static cooler_info_t temp_cooler);
329
+    #if ENABLED(HAS_HEATED_BED)
330
+      static bed_info_t temp_bed;
331
+    #endif
332
+    #if ENABLED(HAS_TEMP_PROBE)
333
+      static probe_info_t temp_probe;
334
+    #endif
335
+    #if ENABLED(HAS_TEMP_CHAMBER)
336
+      static chamber_info_t temp_chamber;
337
+    #endif
338
+    #if ENABLED(HAS_TEMP_COOLER)
339
+      static cooler_info_t temp_cooler;
340
+    #endif
333
 
341
 
334
-    TERN_(AUTO_POWER_E_FANS, static uint8_t autofan_speed[HOTENDS]);
335
-    TERN_(AUTO_POWER_CHAMBER_FAN, static uint8_t chamberfan_speed);
336
-    TERN_(AUTO_POWER_COOLER_FAN, static uint8_t coolerfan_speed);
342
+    #if ENABLED(AUTO_POWER_E_FANS)
343
+      static uint8_t autofan_speed[HOTENDS];
344
+    #endif
345
+    #if ENABLED(AUTO_POWER_CHAMBER_FAN)
346
+      static uint8_t chamberfan_speed;
347
+    #endif
348
+    #if ENABLED(AUTO_POWER_COOLER_FAN)
349
+      static uint8_t coolerfan_speed;
350
+    #endif
337
 
351
 
338
     #if ENABLED(FAN_SOFT_PWM)
352
     #if ENABLED(FAN_SOFT_PWM)
339
       static uint8_t soft_pwm_amount_fan[FAN_COUNT],
353
       static uint8_t soft_pwm_amount_fan[FAN_COUNT],
403
 
417
 
404
   private:
418
   private:
405
 
419
 
406
-    TERN_(EARLY_WATCHDOG, static bool inited);   // If temperature controller is running
420
+    #if ENABLED(EARLY_WATCHDOG)
421
+      static bool inited;   // If temperature controller is running
422
+    #endif
407
 
423
 
408
     static volatile bool raw_temps_ready;
424
     static volatile bool raw_temps_ready;
409
 
425
 
410
-    TERN_(WATCH_HOTENDS, static hotend_watch_t watch_hotend[HOTENDS]);
426
+    #if ENABLED(WATCH_HOTENDS)
427
+      static hotend_watch_t watch_hotend[HOTENDS];
428
+    #endif
411
 
429
 
412
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
430
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
413
       static uint16_t redundant_temperature_raw;
431
       static uint16_t redundant_temperature_raw;
419
       static lpq_ptr_t lpq_ptr;
437
       static lpq_ptr_t lpq_ptr;
420
     #endif
438
     #endif
421
 
439
 
422
-    TERN_(HAS_HOTEND, static temp_range_t temp_range[HOTENDS]);
440
+    #if ENABLED(HAS_HOTEND)
441
+      static temp_range_t temp_range[HOTENDS];
442
+    #endif
423
 
443
 
424
     #if HAS_HEATED_BED
444
     #if HAS_HEATED_BED
425
-      TERN_(WATCH_BED, static bed_watch_t watch_bed);
445
+      #if ENABLED(WATCH_BED)
446
+        static bed_watch_t watch_bed;
447
+      #endif
426
       IF_DISABLED(PIDTEMPBED, static millis_t next_bed_check_ms);
448
       IF_DISABLED(PIDTEMPBED, static millis_t next_bed_check_ms);
427
       static int16_t mintemp_raw_BED, maxtemp_raw_BED;
449
       static int16_t mintemp_raw_BED, maxtemp_raw_BED;
428
     #endif
450
     #endif
429
 
451
 
430
     #if HAS_HEATED_CHAMBER
452
     #if HAS_HEATED_CHAMBER
431
-      TERN_(WATCH_CHAMBER, static chamber_watch_t watch_chamber);
453
+      #if ENABLED(WATCH_CHAMBER)
454
+        static chamber_watch_t watch_chamber;
455
+      #endif
432
       TERN(PIDTEMPCHAMBER,,static millis_t next_chamber_check_ms);
456
       TERN(PIDTEMPCHAMBER,,static millis_t next_chamber_check_ms);
433
       static int16_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER;
457
       static int16_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER;
434
     #endif
458
     #endif
435
 
459
 
436
     #if HAS_COOLER
460
     #if HAS_COOLER
437
-      TERN_(WATCH_COOLER, static cooler_watch_t watch_cooler);
461
+      #if ENABLED(WATCH_COOLER)
462
+        static cooler_watch_t watch_cooler;
463
+      #endif
438
       static millis_t next_cooler_check_ms, cooler_fan_flush_ms;
464
       static millis_t next_cooler_check_ms, cooler_fan_flush_ms;
439
       static int16_t mintemp_raw_COOLER, maxtemp_raw_COOLER;
465
       static int16_t mintemp_raw_COOLER, maxtemp_raw_COOLER;
440
     #endif
466
     #endif
447
       static millis_t preheat_end_time[HOTENDS];
473
       static millis_t preheat_end_time[HOTENDS];
448
     #endif
474
     #endif
449
 
475
 
450
-    TERN_(HAS_AUTO_FAN, static millis_t next_auto_fan_check_ms);
476
+    #if ENABLED(HAS_AUTO_FAN)
477
+      static millis_t next_auto_fan_check_ms;
478
+    #endif
451
 
479
 
452
-    TERN_(PROBING_HEATERS_OFF, static bool paused);
480
+    #if ENABLED(PROBING_HEATERS_OFF)
481
+      static bool paused;
482
+    #endif
453
 
483
 
454
   public:
484
   public:
455
     #if HAS_ADC_BUTTONS
485
     #if HAS_ADC_BUTTONS
457
       static uint16_t ADCKey_count;
487
       static uint16_t ADCKey_count;
458
     #endif
488
     #endif
459
 
489
 
460
-    TERN_(PID_EXTRUSION_SCALING, static int16_t lpq_len);
490
+    #if ENABLED(PID_EXTRUSION_SCALING)
491
+      static int16_t lpq_len;
492
+    #endif
461
 
493
 
462
     /**
494
     /**
463
      * Instance Methods
495
      * Instance Methods
534
 
566
 
535
       static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }
567
       static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); }
536
 
568
 
537
-      TERN_(ADAPTIVE_FAN_SLOWING, static uint8_t fan_speed_scaler[FAN_COUNT]);
569
+      #if ENABLED(ADAPTIVE_FAN_SLOWING)
570
+        static uint8_t fan_speed_scaler[FAN_COUNT];
571
+      #endif
538
 
572
 
539
       static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) {
573
       static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) {
540
         UNUSED(target); // Potentially unused!
574
         UNUSED(target); // Potentially unused!
843
       #endif
877
       #endif
844
     #endif
878
     #endif
845
 
879
 
846
-    TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e));
880
+    #if ENABLED(HAS_DISPLAY)
881
+      static void set_heating_message(const uint8_t e);
882
+    #endif
847
 
883
 
848
     #if HAS_LCD_MENU && HAS_TEMPERATURE
884
     #if HAS_LCD_MENU && HAS_TEMPERATURE
849
       static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
885
       static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
866
 
902
 
867
     static void checkExtruderAutoFans();
903
     static void checkExtruderAutoFans();
868
 
904
 
869
-    TERN_(HAS_HOTEND,     static float get_pid_output_hotend(const uint8_t e));
870
-    TERN_(PIDTEMPBED,     static float get_pid_output_bed());
871
-    TERN_(PIDTEMPCHAMBER, static float get_pid_output_chamber());
905
+    #if ENABLED(HAS_HOTEND)
906
+      static float get_pid_output_hotend(const uint8_t e);
907
+    #endif
908
+    #if ENABLED(PIDTEMPBED)
909
+      static float get_pid_output_bed();
910
+    #endif
911
+    #if ENABLED(PIDTEMPCHAMBER)
912
+      static float get_pid_output_chamber();
913
+    #endif
872
 
914
 
873
     static void _temp_error(const heater_id_t e, PGM_P const serial_msg, PGM_P const lcd_msg);
915
     static void _temp_error(const heater_id_t e, PGM_P const serial_msg, PGM_P const lcd_msg);
874
     static void min_temp_error(const heater_id_t e);
916
     static void min_temp_error(const heater_id_t e);

+ 5
- 3
Marlin/src/module/tool_change.h 파일 보기

109
 
109
 
110
 #endif
110
 #endif
111
 
111
 
112
-TERN_(ELECTROMAGNETIC_SWITCHING_TOOLHEAD, void est_init());
113
-
114
-TERN_(SWITCHING_TOOLHEAD, void swt_init());
112
+#if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
113
+  void est_init();
114
+#elif ENABLED(SWITCHING_TOOLHEAD)
115
+  void swt_init();
116
+#endif
115
 
117
 
116
 /**
118
 /**
117
  * Perform a tool-change, which may result in moving the
119
  * Perform a tool-change, which may result in moving the

+ 3
- 1
Marlin/src/sd/cardreader.cpp 파일 보기

1084
           #if DISABLED(SDSORT_USES_RAM)
1084
           #if DISABLED(SDSORT_USES_RAM)
1085
             selectFileByIndex(o1);              // Pre-fetch the first entry and save it
1085
             selectFileByIndex(o1);              // Pre-fetch the first entry and save it
1086
             strcpy(name1, longest_filename());  // so the loop only needs one fetch
1086
             strcpy(name1, longest_filename());  // so the loop only needs one fetch
1087
-            TERN_(HAS_FOLDER_SORTING, bool dir1 = flag.filenameIsDir);
1087
+            #if ENABLED(HAS_FOLDER_SORTING)
1088
+              bool dir1 = flag.filenameIsDir;
1089
+            #endif
1088
           #endif
1090
           #endif
1089
 
1091
 
1090
           for (uint16_t j = 0; j < i; ++j) {
1092
           for (uint16_t j = 0; j < i; ++j) {

Loading…
취소
저장