Skip to content

Commit

Permalink
🐛 Fix XATC divide-by-zero (MarlinFirmware#23743)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe499 authored and Omkar Dhekne committed Mar 25, 2024
1 parent 7b19d84 commit cba4519
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Marlin/src/feature/bedlevel/abl/x_twist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 XATC::compensation(const xy_pos_t &raw) {
if (NEAR_ZERO(spacing)) return 0;
float t = (raw.x - start) / spacing;
int i = FLOOR(t);
LIMIT(i, 0, XATC_MAX_POINTS - 2);
Expand Down

0 comments on commit cba4519

Please sign in to comment.