Skip to content

Commit

Permalink
Have the tool be in the locked position on power-on
Browse files Browse the repository at this point in the history
  • Loading branch information
MangaValk committed Mar 8, 2020
1 parent 2a71e4f commit 7919170
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
#include "feature/fanmux.h"
#endif

#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, ELECTROMAGNETIC_SWITCHING_TOOLHEAD, SWITCHING_TOOLHEAD)
#include "module/tool_change.h"
#endif

Expand Down Expand Up @@ -1110,6 +1110,10 @@ void setup() {
pe_solenoid_init();
#endif

#if ENABLED(SWITCHING_TOOLHEAD)
swt_init();
#endif

#if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
est_init();
#endif
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a

#if ENABLED(SWITCHING_TOOLHEAD)

void swt_init() {
constexpr uint16_t angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES;

// lock tool.
MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, angles[0]);
}

inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (no_move) return;

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/tool_change.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
void est_init();
#endif

#if ENABLED(SWITCHING_TOOLHEAD)
void swt_init();
#endif

/**
* Perform a tool-change, which may result in moving the
* previous tool out of the way and the new tool into place.
Expand Down

0 comments on commit 7919170

Please sign in to comment.