Ver código fonte

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

Giuseppe499 2 anos atrás
pai
commit
aae08e9b0d
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1
    0
      Marlin/src/feature/bedlevel/abl/x_twist.cpp

+ 1
- 0
Marlin/src/feature/bedlevel/abl/x_twist.cpp Ver arquivo

@@ -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);

Carregando…
Cancelar
Salvar