Browse Source

🐛 Fix XATC divide-by-zero (#23743)

Giuseppe499 3 years ago
parent
commit
aae08e9b0d
No account linked to committer's email address
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      Marlin/src/feature/bedlevel/abl/x_twist.cpp

+ 1
- 0
Marlin/src/feature/bedlevel/abl/x_twist.cpp View File

@@ -49,6 +49,7 @@ void XATC::print_points() {
49 49
 float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); }
50 50
 
51 51
 float XATC::compensation(const xy_pos_t &raw) {
52
+  if (NEAR_ZERO(spacing)) return 0;
52 53
   float t = (raw.x - start) / spacing;
53 54
   int i = FLOOR(t);
54 55
   LIMIT(i, 0, XATC_MAX_POINTS - 2);

Loading…
Cancel
Save