Skip to content

Commit 52693f7

Browse files
committed
🎨 Clean up some checks & includes
1 parent 991f433 commit 52693f7

File tree

20 files changed

+65
-110
lines changed

20 files changed

+65
-110
lines changed

Marlin/src/MarlinCore.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
776776
if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
777777

778778
// TODO: Still causing errors
779-
(void)check_tool_sensor_stats(active_extruder, true);
779+
TERN_(TOOL_SENSOR, (void)check_tool_sensor_stats(active_extruder, true));
780780

781781
// Handle filament runout sensors
782782
#if HAS_FILAMENT_SENSOR

Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
#include "../../../gcode/gcode.h"
3838
#include "../../../libs/least_squares_fit.h"
3939

40-
#if HAS_MULTI_HOTEND
41-
#include "../../../module/tool_change.h"
42-
#endif
43-
4440
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
4541
#include "../../../core/debug_out.h"
4642

Marlin/src/feature/mixing.h

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343

4444
typedef int8_t mixer_perc_t;
4545

46-
#ifndef MIXING_VIRTUAL_TOOLS
47-
#define MIXING_VIRTUAL_TOOLS 1
48-
#endif
49-
5046
enum MixTool {
5147
FIRST_USER_VIRTUAL_TOOL = 0
5248
, LAST_USER_VIRTUAL_TOOL = MIXING_VIRTUAL_TOOLS - 1

Marlin/src/feature/solenoid.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "solenoid.h"
2828

2929
#include "../module/motion.h" // for active_extruder
30-
#include "../module/tool_change.h"
30+
#include "../module/tool_change.h" // for parking_extruder_set_parked
3131

3232
// Used primarily with MANUAL_SOLENOID_CONTROL
3333
static void set_solenoid(const uint8_t num, const uint8_t state) {

Marlin/src/gcode/bedlevel/G35.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
#include "../../module/probe.h"
3030
#include "../../feature/bedlevel/bedlevel.h"
3131

32-
#if HAS_MULTI_HOTEND
33-
#include "../../module/tool_change.h"
34-
#endif
35-
3632
#if ENABLED(BLTOUCH)
3733
#include "../../feature/bltouch.h"
3834
#endif

Marlin/src/gcode/bedlevel/abl/G29.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
#include "../../../lcd/e3v2/proui/dwin.h"
5656
#endif
5757

58-
#if HAS_MULTI_HOTEND
59-
#include "../../../module/tool_change.h"
60-
#endif
61-
6258
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
6359
#include "../../../core/debug_out.h"
6460

Marlin/src/gcode/calibrate/G33.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
#include "../../module/probe.h"
3636
#endif
3737

38-
#if HAS_MULTI_HOTEND
39-
#include "../../module/tool_change.h"
40-
#endif
41-
4238
#if HAS_LEVELING
4339
#include "../../feature/bedlevel/bedlevel.h"
4440
#endif

Marlin/src/gcode/calibrate/G34_M422.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
#include "../../feature/bedlevel/bedlevel.h"
3838
#endif
3939

40-
#if HAS_MULTI_HOTEND
41-
#include "../../module/tool_change.h"
42-
#endif
43-
4440
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
4541
#include "../../libs/least_squares_fit.h"
4642
#endif

Marlin/src/gcode/calibrate/G425.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@
3333
#include "../../lcd/marlinui.h"
3434
#include "../../module/motion.h"
3535
#include "../../module/planner.h"
36-
#include "../../module/tool_change.h"
3736
#include "../../module/endstops.h"
3837
#include "../../feature/bedlevel/bedlevel.h"
3938

39+
#if HAS_MULTI_HOTEND
40+
#include "../../module/tool_change.h"
41+
#endif
42+
4043
#if !AXIS_CAN_CALIBRATE(X)
4144
#undef CALIBRATION_MEASURE_LEFT
4245
#undef CALIBRATION_MEASURE_RIGHT

Marlin/src/gcode/config/M217.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828
#include "../../module/tool_change.h"
2929

3030
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
31-
#include "../../module/motion.h"
31+
#include "../../module/motion.h" // for active_extruder
3232
#endif
3333

34-
#include "../../MarlinCore.h" // for SP_X_STR, etc.
35-
3634
/**
3735
* M217 - Set toolchange parameters
3836
*

Marlin/src/gcode/control/T.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ void GcodeSuite::T(const int8_t tool_index) {
7171

7272
tool_change(tool_index
7373
#if HAS_MULTI_EXTRUDER
74-
, TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
75-
|| parser.boolval('S')
74+
, parser.boolval('S')
75+
|| TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
7676
#endif
7777
);
7878
}

Marlin/src/gcode/feature/pause/M603.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
#include "../../../module/motion.h"
3030
#include "../../../module/printcounter.h"
3131

32-
#if HAS_MULTI_EXTRUDER
33-
#include "../../../module/tool_change.h"
34-
#endif
35-
3632
/**
3733
* M603: Configure filament change
3834
*

Marlin/src/gcode/probe/G30.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#include "../../feature/probe_temp_comp.h"
3535
#endif
3636

37-
#if HAS_MULTI_HOTEND
38-
#include "../../module/tool_change.h"
39-
#endif
40-
4137
/**
4238
* G30: Do a single Z probe at the given XY (default: current)
4339
*

Marlin/src/gcode/temp/M104_M109.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545
#endif
4646
#endif
4747

48-
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
49-
#include "../../module/tool_change.h"
50-
#endif
51-
5248
/**
5349
* M104: Set Hotend Temperature target and return immediately
5450
* M109: Set Hotend Temperature target and wait

Marlin/src/inc/Changes.h

+32
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,18 @@
579579
#error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
580580
#elif defined(NUM_Z_STEPPER_DRIVERS)
581581
#error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed."
582+
#elif defined(SNMM)
583+
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
584+
#elif defined(MK2_MULTIPLEXER)
585+
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
586+
#elif defined(PRUSA_MMU2)
587+
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
588+
#elif defined(PRUSA_MMU2_S_MODE)
589+
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
590+
#elif defined(SMUFF_EMU_MMU2)
591+
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
592+
#elif defined(SMUFF_EMU_MMU2S)
593+
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
582594
#elif defined(LEVEL_BED_CORNERS)
583595
#error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING."
584596
#elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK)
@@ -675,6 +687,26 @@
675687
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13."
676688
#endif
677689

690+
// Changes to Probe Temp Compensation (#17392)
691+
#if HAS_PTC && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
692+
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
693+
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
694+
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
695+
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
696+
#endif
697+
#endif
698+
699+
// Consolidate TMC26X, validate migration (#24373)
700+
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
701+
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
702+
#if DO(ISMAX,||,ALL_AXIS_NAMES)
703+
#error "*_MAX_CURRENT is now set with *_CURRENT."
704+
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
705+
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
706+
#endif
707+
#undef _ISMAX_1
708+
#undef _ISSNS_1
709+
678710
// L64xx stepper drivers have been removed
679711
#define _L6470 0x6470
680712
#define _L6474 0x6474

Marlin/src/inc/Conditionals_LCD.h

+22-16
Original file line numberDiff line numberDiff line change
@@ -82,33 +82,36 @@
8282
/**
8383
* Multi-Material-Unit supported models
8484
*/
85-
#define PRUSA_MMU1 1
86-
#define PRUSA_MMU2 2
87-
#define PRUSA_MMU2S 3
88-
#define EXTENDABLE_EMU_MMU2 12
89-
#define EXTENDABLE_EMU_MMU2S 13
90-
9185
#ifdef MMU_MODEL
9286
#define HAS_MMU 1
9387
#define SINGLENOZZLE
94-
#if MMU_MODEL == PRUSA_MMU1
88+
89+
#define _PRUSA_MMU1 1
90+
#define _PRUSA_MMU2 2
91+
#define _PRUSA_MMU2S 3
92+
#define _EXTENDABLE_EMU_MMU2 12
93+
#define _EXTENDABLE_EMU_MMU2S 13
94+
#define _MMU CAT(_,MMU_MODEL)
95+
96+
#if _MMU == _PRUSA_MMU1
9597
#define HAS_PRUSA_MMU1 1
96-
#elif MMU_MODEL % 10 == PRUSA_MMU2
98+
#elif _MMU % 10 == _PRUSA_MMU2
9799
#define HAS_PRUSA_MMU2 1
98-
#elif MMU_MODEL % 10 == PRUSA_MMU2S
100+
#elif _MMU % 10 == _PRUSA_MMU2S
99101
#define HAS_PRUSA_MMU2 1
100102
#define HAS_PRUSA_MMU2S 1
101103
#endif
102-
#if MMU_MODEL >= EXTENDABLE_EMU_MMU2
104+
#if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S
103105
#define HAS_EXTENDABLE_MMU 1
104106
#endif
105-
#endif
106107

107-
#undef PRUSA_MMU1
108-
#undef PRUSA_MMU2
109-
#undef PRUSA_MMU2S
110-
#undef EXTENDABLE_EMU_MMU2
111-
#undef EXTENDABLE_EMU_MMU2S
108+
#undef _MMU
109+
#undef _PRUSA_MMU1
110+
#undef _PRUSA_MMU2
111+
#undef _PRUSA_MMU2S
112+
#undef _EXTENDABLE_EMU_MMU2
113+
#undef _EXTENDABLE_EMU_MMU2S
114+
#endif
112115

113116
#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0
114117

@@ -132,6 +135,9 @@
132135
#if MIXING_STEPPERS == 2
133136
#define HAS_DUAL_MIXING 1
134137
#endif
138+
#ifndef MIXING_VIRTUAL_TOOLS
139+
#define MIXING_VIRTUAL_TOOLS 1
140+
#endif
135141

136142
#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger
137143

Marlin/src/inc/SanityCheck.h

+2-38
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,6 @@
116116
constexpr float arm[] = AXIS_RELATIVE_MODES;
117117
static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
118118

119-
// Consolidate TMC26X, validate migration (#24373)
120-
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
121-
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
122-
#if DO(ISMAX,||,ALL_AXIS_NAMES)
123-
#error "*_MAX_CURRENT is now set with *_CURRENT."
124-
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
125-
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
126-
#endif
127-
#undef _ISMAX_1
128-
#undef _ISSNS_1
129-
130119
/**
131120
* RADDS is forbidden for non-DUE boards, for now.
132121
*/
@@ -160,16 +149,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
160149
* Probe temp compensation requirements
161150
*/
162151
#if HAS_PTC
163-
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
164-
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
165-
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
166-
#elif !defined(PTC_PARK_POS)
167-
#error "PTC_PARK_POS is required for Probe Temperature Compensation."
168-
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
169-
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
170-
#elif !defined(PTC_PROBE_POS)
171-
#error "PTC_PROBE_POS is required for Probe Temperature Compensation."
172-
#endif
152+
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED && !(defined(PTC_PARK_POS) && defined(PTC_PROBE_POS))
153+
#error "PTC_PARK_POS and PTC_PROBE_POS are required for Probe Temperature Compensation."
173154
#endif
174155

175156
#if ENABLED(PTC_PROBE)
@@ -611,23 +592,6 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
611592
#error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
612593
#endif
613594

614-
/**
615-
* Sanity checking for all Průša MMU
616-
*/
617-
#ifdef SNMM
618-
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
619-
#elif ENABLED(MK2_MULTIPLEXER)
620-
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
621-
#elif ENABLED(PRUSA_MMU2)
622-
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
623-
#elif ENABLED(PRUSA_MMU2_S_MODE)
624-
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
625-
#elif ENABLED(SMUFF_EMU_MMU2)
626-
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
627-
#elif ENABLED(SMUFF_EMU_MMU2S)
628-
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
629-
#endif
630-
631595
/**
632596
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
633597
*/

Marlin/src/lcd/menu/menu_temperature.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
#include "../../feature/cooler.h"
4040
#endif
4141

42-
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
43-
#include "../../module/tool_change.h"
44-
#endif
45-
4642
//
4743
// "Temperature" submenu items
4844
//

Marlin/src/lcd/menu/menu_tune.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#include "../../module/temperature.h"
3535
#include "../../MarlinCore.h"
3636

37-
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
38-
#include "../../module/tool_change.h"
39-
#endif
40-
4137
#if HAS_LEVELING
4238
#include "../../feature/bedlevel/bedlevel.h"
4339
#endif

Marlin/src/module/temperature.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@
182182
#include "../feature/joystick.h"
183183
#endif
184184

185-
#if ENABLED(SINGLENOZZLE)
186-
#include "tool_change.h"
187-
#endif
188-
189185
#if HAS_BEEPER
190186
#include "../libs/buzzer.h"
191187
#endif

0 commit comments

Comments
 (0)