Skip to content

Commit a53290c

Browse files
committed
cleanup
1 parent a804e59 commit a53290c

File tree

5 files changed

+33
-38
lines changed

5 files changed

+33
-38
lines changed

Marlin/src/feature/mmu/mmu2.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
815815
resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
816816
resume_position = current_position;
817817

818-
if (move_axes && all_axes_homed())
819-
nozzle.park(0, park_point /*= NOZZLE_PARK_POINT*/);
818+
if (move_axes && all_axes_homed()) nozzle.park(0, park_point);
820819

821820
if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder);
822821

Marlin/src/inc/SanityCheck.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,11 +1148,11 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
11481148

11491149
#if ENABLED(NOZZLE_PARK_FEATURE)
11501150
constexpr float npp[] = NOZZLE_PARK_POINT;
1151-
static_assert(COUNT(npp) == NUM_AXES, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
1151+
static_assert(COUNT(npp) == _MIN(NUM_AXES, XYZ), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z.");
11521152
constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
11531153
static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
1154-
static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
1155-
static_assert(TERN1(HAS_Z_AXIS,WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS)), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
1154+
static_assert(TERN1(HAS_Y_AXIS, WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS)), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
1155+
static_assert(TERN1(HAS_Z_AXIS, WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS)), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
11561156
#endif
11571157

11581158
/**

Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,8 @@ void MarlinUI::draw_status_screen() {
999999
#endif // LCD_WIDTH >= 20
10001000

10011001
#if HAS_Z_AXIS
1002-
lcd_moveto(LCD_WIDTH - 8, 1);
1003-
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
1002+
lcd_moveto(LCD_WIDTH - 8, 1);
1003+
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
10041004
#endif
10051005

10061006
#if HAS_LEVELING && !HAS_HEATED_BED

Marlin/src/libs/nozzle.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -226,42 +226,42 @@ Nozzle nozzle;
226226
#if ENABLED(NOZZLE_PARK_FEATURE)
227227

228228
#if HAS_Z_AXIS
229-
float Nozzle::park_mode_0_height(const_float_t park_z) {
230-
// Apply a minimum raise, if specified. Use park.z as a minimum height instead.
231-
return _MAX(park_z, // Minimum height over 0 based on input
232-
_MIN(Z_MAX_POS, // Maximum height is fixed
233-
#ifdef NOZZLE_PARK_Z_RAISE_MIN
234-
NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
235-
#endif
236-
current_position.z // ...over current position
237-
)
238-
);
239-
}
240-
#endif
229+
float Nozzle::park_mode_0_height(const_float_t park_z) {
230+
// Apply a minimum raise, if specified. Use park.z as a minimum height instead.
231+
return _MAX(park_z, // Minimum height over 0 based on input
232+
_MIN(Z_MAX_POS, // Maximum height is fixed
233+
#ifdef NOZZLE_PARK_Z_RAISE_MIN
234+
NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
235+
#endif
236+
current_position.z // ...over current position
237+
)
238+
);
239+
}
240+
#endif // HAS_Z_AXIS
241241

242242
void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) {
243-
constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE;
244243
#if HAS_Z_AXIS
245-
constexpr feedRate_t fr_z = NOZZLE_PARK_Z_FEEDRATE;
244+
constexpr feedRate_t fr_z = NOZZLE_PARK_Z_FEEDRATE;
246245

247-
switch (z_action) {
248-
case 1: // Go to Z-park height
249-
do_blocking_move_to_z(park.z, fr_z);
250-
break;
246+
switch (z_action) {
247+
case 1: // Go to Z-park height
248+
do_blocking_move_to_z(park.z, fr_z);
249+
break;
251250

252-
case 2: // Raise by Z-park height
253-
do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
254-
break;
251+
case 2: // Raise by Z-park height
252+
do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
253+
break;
255254

256-
default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
257-
do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
258-
break;
259-
}
260-
#endif
255+
default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
256+
do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
257+
break;
258+
}
259+
#endif // HAS_Z_AXIS
261260

262261
#ifndef NOZZLE_PARK_MOVE
263262
#define NOZZLE_PARK_MOVE 0
264263
#endif
264+
constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE;
265265
switch (NOZZLE_PARK_MOVE) {
266266
case 0: do_blocking_move_to_xy(park, fr_xy); break;
267267
case 1: do_blocking_move_to_x(park.x, fr_xy); break;

Marlin/src/module/polargraph.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ xy_pos_t draw_area_min, draw_area_max;
4343

4444
void inverse_kinematics(const xyz_pos_t &raw) {
4545
const float x1 = raw.x - draw_area_min.x, x2 = draw_area_max.x - raw.x, y = raw.y - draw_area_max.y;
46-
#if HAS_Z_AXIS
47-
delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z);
48-
#else
49-
delta.set(HYPOT(x1, y), HYPOT(x2, y));
50-
#endif
46+
delta.set(HYPOT(x1, y), HYPOT(x2, y) OPTARG(HAS_Z_AXIS, raw.z));
5147
}
5248

5349
#endif // POLARGRAPH

0 commit comments

Comments
 (0)