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

Loading…
Cancel
Save