Skip to content

Commit 4a5bd47

Browse files
committed
🎨 Apply MUL_TERN
1 parent e5742a9 commit 4a5bd47

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

Marlin/src/feature/fwretract.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
137137
// Retract by moving from a faux E position back to the current E position
138138
current_retract[active_extruder] = base_retract;
139139
prepare_internal_move_to_destination( // set current from destination
140-
settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
140+
MUL_TERN(RETRACT_SYNC_MIXING, settings.retract_feedrate_mm_s, MIXING_STEPPERS)
141141
);
142142

143143
// Is a Z hop set, and has the hop not yet been done?
@@ -165,8 +165,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
165165

166166
// Recover E, set_current_to_destination
167167
prepare_internal_move_to_destination(
168-
(swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s)
169-
* TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
168+
MUL_TERN(RETRACT_SYNC_MIXING, swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s, MIXING_STEPPERS)
170169
);
171170
}
172171

Marlin/src/feature/leds/neopixel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Marlin_NeoPixel {
130130
}
131131

132132
// Accessors
133-
static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); }
133+
static uint16_t pixels() { return MUL_TERN(NEOPIXEL2_INSERIES, adaneo1.numPixels(), 2); }
134134

135135
static uint32_t pixel_color(const uint16_t n) {
136136
#if ENABLED(NEOPIXEL2_INSERIES)

Marlin/src/module/planner.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -2392,14 +2392,12 @@ bool Planner::_populate_block(
23922392
#endif
23932393

23942394
const feedRate_t cs = ABS(current_speed.e),
2395-
max_fr = settings.max_feedrate_mm_s[E_AXIS_N(extruder)]
2396-
* TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1);
2395+
max_fr = MUL_TERN(HAS_MIXER_SYNC_CHANNEL, settings.max_feedrate_mm_s[E_AXIS_N(extruder)], MIXING_STEPPERS);
23972396

2398-
if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); //respect max feedrate on any movement (doesn't matter if E axes only or not)
2397+
if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); // Respect max feedrate on any move (travel and print)
23992398

24002399
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
2401-
const feedRate_t max_vfr = volumetric_extruder_feedrate_limit[extruder]
2402-
* TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1);
2400+
const feedRate_t max_vfr = MUL_TERN(HAS_MIXER_SYNC_CHANNEL, volumetric_extruder_feedrate_limit[extruder], MIXING_STEPPERS);
24032401

24042402
// TODO: Doesn't work properly for joined segments. Set MIN_STEPS_PER_SEGMENT 1 as workaround.
24052403

Marlin/src/module/planner.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class Planner {
634634

635635
#if HAS_EXTRUDERS
636636
FORCE_INLINE static void refresh_e_factor(const uint8_t e) {
637-
e_factor[e] = flow_percentage[e] * 0.01f * TERN(NO_VOLUMETRICS, 1.0f, volumetric_multiplier[e]);
637+
e_factor[e] = flow_percentage[e] * 0.01f IF_DISABLED(NO_VOLUMETRICS, * volumetric_multiplier[e]);
638638
}
639639

640640
static void set_flow(const uint8_t e, const int16_t flow) {

0 commit comments

Comments
 (0)