🎨 Misc code and spacing cleanup
This commit is contained in:
@ -1388,9 +1388,7 @@ void Planner::check_axes_activity() {
|
||||
// Update Fan speeds
|
||||
// Only if synchronous M106/M107 is disabled
|
||||
//
|
||||
#if HAS_TAIL_FAN_SPEED
|
||||
sync_fan_speeds(tail_fan_speed);
|
||||
#endif
|
||||
TERN_(HAS_TAIL_FAN_SPEED, sync_fan_speeds(tail_fan_speed));
|
||||
|
||||
TERN_(AUTOTEMP, autotemp_task());
|
||||
|
||||
@ -1585,11 +1583,7 @@ void Planner::check_axes_activity() {
|
||||
|
||||
raw.z += (
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
mbl.get_z(raw
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
, fade_scaling_factor
|
||||
#endif
|
||||
)
|
||||
mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor))
|
||||
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
@ -1622,11 +1616,7 @@ void Planner::check_axes_activity() {
|
||||
|
||||
raw.z -= (
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
mbl.get_z(raw
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
, fade_scaling_factor
|
||||
#endif
|
||||
)
|
||||
mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor))
|
||||
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
@ -1811,12 +1801,8 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
||||
|
||||
// Fill the block with the specified movement
|
||||
if (!_populate_block(block, false, target
|
||||
#if HAS_POSITION_FLOAT
|
||||
, target_float
|
||||
#endif
|
||||
#if HAS_DIST_MM_ARG
|
||||
, cart_dist_mm
|
||||
#endif
|
||||
OPTARG(HAS_POSITION_FLOAT, target_float)
|
||||
OPTARG(HAS_DIST_MM_ARG, cart_dist_mm)
|
||||
, fr_mm_s, extruder, millimeters
|
||||
)) {
|
||||
// Movement was not queued, probably because it was too short.
|
||||
@ -1975,9 +1961,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
if (de < 0) SBI(dm, E_AXIS);
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (de < 0) SBI(dm, E_AXIS));
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
const float esteps_float = de * e_factor[extruder];
|
||||
@ -2075,9 +2059,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
);
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
steps_dist_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)];
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, steps_dist_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)]);
|
||||
|
||||
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator += steps_dist_mm.e);
|
||||
|
||||
@ -2162,9 +2144,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
block->e_to_p_pressure = baricuda_e_to_p_pressure;
|
||||
#endif
|
||||
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
block->extruder = extruder;
|
||||
#endif
|
||||
TERN_(HAS_MULTI_EXTRUDER, block->extruder = extruder);
|
||||
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
if (LINEAR_AXIS_GANG(
|
||||
@ -2986,12 +2966,8 @@ bool Planner::buffer_segment(const abce_pos_t &abce
|
||||
|
||||
// Queue the movement. Return 'false' if the move was not queued.
|
||||
if (!_buffer_steps(target
|
||||
#if HAS_POSITION_FLOAT
|
||||
, target_float
|
||||
#endif
|
||||
#if HAS_DIST_MM_ARG
|
||||
, cart_dist_mm
|
||||
#endif
|
||||
OPTARG(HAS_POSITION_FLOAT, target_float)
|
||||
OPTARG(HAS_DIST_MM_ARG, cart_dist_mm)
|
||||
, fr_mm_s, extruder, millimeters)
|
||||
) return false;
|
||||
|
||||
|
@ -2555,9 +2555,7 @@ void MarlinSettings::reset() {
|
||||
TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK);
|
||||
#endif
|
||||
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM);
|
||||
#endif
|
||||
TERN_(HAS_JUNCTION_DEVIATION, planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM));
|
||||
|
||||
#if HAS_SCARA_OFFSET
|
||||
scara_home_offset.reset();
|
||||
@ -3151,9 +3149,7 @@ void MarlinSettings::reset() {
|
||||
|
||||
CONFIG_ECHO_HEADING(
|
||||
"Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
" J<junc_dev>"
|
||||
#endif
|
||||
TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
|
||||
#if HAS_CLASSIC_JERK
|
||||
" X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>"
|
||||
TERN_(HAS_CLASSIC_E_JERK, " E<max_e_jerk>")
|
||||
|
@ -1428,14 +1428,10 @@ void Stepper::isr() {
|
||||
|
||||
// Get the interval to the next ISR call
|
||||
const uint32_t interval = _MIN(
|
||||
uint32_t(HAL_TIMER_TYPE_MAX), // Come back in a very long time
|
||||
nextMainISR // Time until the next Pulse / Block phase
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
, nextAdvanceISR // Come back early for Linear Advance?
|
||||
#endif
|
||||
#if ENABLED(INTEGRATED_BABYSTEPPING)
|
||||
, nextBabystepISR // Come back early for Babystepping?
|
||||
#endif
|
||||
, uint32_t(HAL_TIMER_TYPE_MAX) // Come back in a very long time
|
||||
OPTARG(LIN_ADVANCE, nextAdvanceISR) // Come back early for Linear Advance?
|
||||
OPTARG(INTEGRATED_BABYSTEPPING, nextBabystepISR) // Come back early for Babystepping?
|
||||
);
|
||||
|
||||
//
|
||||
|
@ -121,7 +121,7 @@ void reset_trinamic_drivers();
|
||||
#define X_ENABLE_READ() stepperX.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(X)
|
||||
#define X_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X_STEP_PIN); }while(0)
|
||||
#define X_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -149,7 +149,7 @@ void reset_trinamic_drivers();
|
||||
#define Z_ENABLE_READ() stepperZ.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(Z)
|
||||
#define Z_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z_STEP_PIN); }while(0)
|
||||
#define Z_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -166,7 +166,7 @@ void reset_trinamic_drivers();
|
||||
#define X2_ENABLE_READ() stepperX2.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(X2)
|
||||
#define X2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X2_STEP_PIN); }while(0)
|
||||
#define X2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X2_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -183,7 +183,7 @@ void reset_trinamic_drivers();
|
||||
#define Y2_ENABLE_READ() stepperY2.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(Y2)
|
||||
#define Y2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Y2_STEP_PIN); }while(0)
|
||||
#define Y2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y2_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -200,7 +200,7 @@ void reset_trinamic_drivers();
|
||||
#define Z2_ENABLE_READ() stepperZ2.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(Z2)
|
||||
#define Z2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z2_STEP_PIN); }while(0)
|
||||
#define Z2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z2_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -217,7 +217,7 @@ void reset_trinamic_drivers();
|
||||
#define Z3_ENABLE_READ() stepperZ3.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(Z3)
|
||||
#define Z3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z3_STEP_PIN); }while(0)
|
||||
#define Z3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z3_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -234,7 +234,7 @@ void reset_trinamic_drivers();
|
||||
#define Z4_ENABLE_READ() stepperZ4.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(Z4)
|
||||
#define Z4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z4_STEP_PIN); }while(0)
|
||||
#define Z4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z4_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -293,7 +293,7 @@ void reset_trinamic_drivers();
|
||||
#define E0_ENABLE_READ() stepperE0.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E0)
|
||||
#define E0_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E0_STEP_PIN); }while(0)
|
||||
#define E0_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E0_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -310,7 +310,7 @@ void reset_trinamic_drivers();
|
||||
#define E1_ENABLE_READ() stepperE1.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E1)
|
||||
#define E1_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E1_STEP_PIN); }while(0)
|
||||
#define E1_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E1_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -327,7 +327,7 @@ void reset_trinamic_drivers();
|
||||
#define E2_ENABLE_READ() stepperE2.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E2)
|
||||
#define E2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E2_STEP_PIN); }while(0)
|
||||
#define E2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E2_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -344,7 +344,7 @@ void reset_trinamic_drivers();
|
||||
#define E3_ENABLE_READ() stepperE3.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E3)
|
||||
#define E3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E3_STEP_PIN); }while(0)
|
||||
#define E3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E3_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -361,7 +361,7 @@ void reset_trinamic_drivers();
|
||||
#define E4_ENABLE_READ() stepperE4.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E4)
|
||||
#define E4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E4_STEP_PIN); }while(0)
|
||||
#define E4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E4_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -378,7 +378,7 @@ void reset_trinamic_drivers();
|
||||
#define E5_ENABLE_READ() stepperE5.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E5)
|
||||
#define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0)
|
||||
#define E5_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E5_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -395,7 +395,7 @@ void reset_trinamic_drivers();
|
||||
#define E6_ENABLE_READ() stepperE6.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E6)
|
||||
#define E6_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E6_STEP_PIN); }while(0)
|
||||
#define E6_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E6_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -412,6 +412,6 @@ void reset_trinamic_drivers();
|
||||
#define E7_ENABLE_READ() stepperE7.isEnabled()
|
||||
#endif
|
||||
#if AXIS_HAS_SQUARE_WAVE(E7)
|
||||
#define E7_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E7_STEP_PIN); }while(0)
|
||||
#define E7_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E7_STEP_PIN); }while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -2288,9 +2288,7 @@ void Temperature::init() {
|
||||
INIT_FAN_PIN(CONTROLLER_FAN_PIN);
|
||||
#endif
|
||||
|
||||
#if HAS_MAXTC_SW_SPI
|
||||
max_tc_spi.init();
|
||||
#endif
|
||||
TERN_(HAS_MAXTC_SW_SPI, max_tc_spi.init());
|
||||
|
||||
HAL_adc_init();
|
||||
|
||||
@ -3037,15 +3035,15 @@ void Temperature::isr() {
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
_PWM_MOD(BED,soft_pwm_bed,temp_bed);
|
||||
_PWM_MOD(BED, soft_pwm_bed, temp_bed);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
_PWM_MOD(CHAMBER,soft_pwm_chamber,temp_chamber);
|
||||
_PWM_MOD(CHAMBER, soft_pwm_chamber, temp_chamber);
|
||||
#endif
|
||||
|
||||
#if HAS_COOLER
|
||||
_PWM_MOD(COOLER,soft_pwm_cooler,temp_cooler);
|
||||
_PWM_MOD(COOLER, soft_pwm_cooler, temp_cooler);
|
||||
#endif
|
||||
|
||||
#if ENABLED(FAN_SOFT_PWM)
|
||||
|
@ -918,9 +918,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
if (ok) {
|
||||
// Do a small lift to avoid the workpiece in the move back (below)
|
||||
current_position.z += toolchange_settings.z_raise;
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
NOMORE(current_position.z, soft_endstop.max.z);
|
||||
#endif
|
||||
TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
|
||||
fast_line_to_current(Z_AXIS);
|
||||
planner.synchronize();
|
||||
}
|
||||
@ -1068,9 +1066,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
|
||||
// Do a small lift to avoid the workpiece in the move back (below)
|
||||
current_position.z += toolchange_settings.z_raise;
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
NOMORE(current_position.z, soft_endstop.max.z);
|
||||
#endif
|
||||
TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
|
||||
fast_line_to_current(Z_AXIS);
|
||||
planner.synchronize();
|
||||
}
|
||||
@ -1117,9 +1113,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
|
||||
// Do a small lift to avoid the workpiece in the move back (below)
|
||||
current_position.z += toolchange_settings.z_raise;
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
NOMORE(current_position.z, soft_endstop.max.z);
|
||||
#endif
|
||||
TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
|
||||
fast_line_to_current(Z_AXIS);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user