🎨 Clean up tool change with tool sensor

This commit is contained in:
Scott Lahteine 2022-03-22 20:31:36 -05:00 committed by Scott Lahteine
parent 2d99a608fd
commit b094a3fc0d

View file

@ -385,12 +385,13 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
#endif // PARKING_EXTRUDER
#if ENABLED(SWITCHING_TOOLHEAD)
#if ENABLED(TOOL_SENSOR)
bool tool_sensor_disabled; // = false
// Return a bitmask of tool sensor states
inline uint8_t poll_tool_sensor_pins() {
return (0
#if ENABLED(TOOL_SENSOR)
#if PIN_EXISTS(TOOL_SENSOR1)
| (READ(TOOL_SENSOR1_PIN) << 0)
#endif
@ -415,14 +416,9 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
#if PIN_EXISTS(TOOL_SENSOR8)
| (READ(TOOL_SENSOR8_PIN) << 7)
#endif
#endif
);
}
#if ENABLED(TOOL_SENSOR)
bool tool_sensor_disabled; // = false
uint8_t check_tool_sensor_stats(const uint8_t tool_index, const bool kill_on_error/*=false*/, const bool disable/*=false*/) {
static uint8_t sensor_tries; // = 0
for (;;) {
@ -443,8 +439,6 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
}
}
#endif
inline void switching_toolhead_lock(const bool locked) {
#ifdef SWITCHING_TOOLHEAD_SERVO_ANGLES
const uint16_t swt_angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES;
@ -496,9 +490,13 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
switching_toolhead_lock(true);
}
LCD_MESSAGE_F("TC Success");
#endif
#endif // TOOL_SENSOR
}
#endif // TOOL_SENSOR
#if ENABLED(SWITCHING_TOOLHEAD)
inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (no_move) return;