Encapsulate probe as singleton class (#16751)

This commit is contained in:
Scott Lahteine
2020-02-01 04:21:36 -06:00
committed by GitHub
parent 43d3463d5d
commit 90b6324563
33 changed files with 341 additions and 303 deletions

View File

@ -329,7 +329,7 @@ void homeaxis(const AxisEnum axis);
// Return true if the both nozzle and the probe can reach the given point.
// Note: This won't work on SCARA since the probe offset rotates with the arm.
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
return position_is_reachable(rx - probe_offset.x, ry - probe_offset.y)
return position_is_reachable(rx - probe.offset_xy.x, ry - probe.offset_xy.y)
&& position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE));
}
@ -369,9 +369,9 @@ void homeaxis(const AxisEnum axis);
* nozzle must be be able to reach +10,-10.
*/
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
return position_is_reachable(rx - probe_offset_xy.x, ry - probe_offset_xy.y)
&& WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop)
&& WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop);
return position_is_reachable(rx - probe.offset_xy.x, ry - probe.offset_xy.y)
&& WITHIN(rx, probe.min_x() - slop, probe.max_x() + slop)
&& WITHIN(ry, probe.min_y() - slop, probe.max_y() + slop);
}
#endif // HAS_BED_PROBE