* Switches to the appropriate tool (PROBING_TOOL) for probing (probing = true), and switches * back to the old tool when probing = false. Uses statics to avoid unnecessary checks and to * cache the previous tool, so always call with false after calling with true. */
| 938 | * cache the previous tool, so always call with false after calling with true. |
| 939 | */ |
| 940 | void Probe::use_probing_tool(const bool probing/*=true*/) { |
| 941 | static uint8_t old_tool; |
| 942 | static bool old_state = false; |
| 943 | if (probing == old_state) return; |
| 944 | old_state = probing; |
| 945 | if (probing) old_tool = active_extruder; |
| 946 | const uint8_t tool = probing ? PROBING_TOOL : old_tool; |
| 947 | if (tool != active_extruder) |
| 948 | tool_change(tool, ENABLED(PROBE_TOOLCHANGE_NO_MOVE)); |
| 949 | } |
| 950 | |
| 951 | #endif |
| 952 |
no test coverage detected