mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-01-31 22:20:56 +00:00
🐛 Fix XATC divide-by-zero (#23743)
This commit is contained in:
parent
cd4c1be641
commit
aae08e9b0d
1 changed files with 1 additions and 0 deletions
|
@ -49,6 +49,7 @@ void XATC::print_points() {
|
||||||
float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); }
|
float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); }
|
||||||
|
|
||||||
float XATC::compensation(const xy_pos_t &raw) {
|
float XATC::compensation(const xy_pos_t &raw) {
|
||||||
|
if (NEAR_ZERO(spacing)) return 0;
|
||||||
float t = (raw.x - start) / spacing;
|
float t = (raw.x - start) / spacing;
|
||||||
int i = FLOOR(t);
|
int i = FLOOR(t);
|
||||||
LIMIT(i, 0, XATC_MAX_POINTS - 2);
|
LIMIT(i, 0, XATC_MAX_POINTS - 2);
|
||||||
|
|
Loading…
Reference in a new issue