Browse Source

Merge pull request #5808 from thinkyhead/rc_delta_float_radius

Cast DELTA_PRINTABLE_RADIUS to float in sq()
Scott Lahteine 7 years ago
parent
commit
c64ecf95e2
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 1
    1
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/Marlin_main.cpp View File

2937
       return HYPOT2(dx - SCARA_OFFSET_X, dy - SCARA_OFFSET_Y) <= sq(L1 + L2);
2937
       return HYPOT2(dx - SCARA_OFFSET_X, dy - SCARA_OFFSET_Y) <= sq(L1 + L2);
2938
     #endif
2938
     #endif
2939
   #elif ENABLED(DELTA)
2939
   #elif ENABLED(DELTA)
2940
-    return HYPOT2(dx, dy) <= sq(DELTA_PRINTABLE_RADIUS);
2940
+    return HYPOT2(dx, dy) <= sq((float)(DELTA_PRINTABLE_RADIUS));
2941
   #else
2941
   #else
2942
     const float dz = RAW_Z_POSITION(target[Z_AXIS]);
2942
     const float dz = RAW_Z_POSITION(target[Z_AXIS]);
2943
     return dx >= X_MIN_POS - 0.0001 && dx <= X_MAX_POS + 0.0001
2943
     return dx >= X_MIN_POS - 0.0001 && dx <= X_MAX_POS + 0.0001

+ 1
- 1
Marlin/ultralcd.cpp View File

1554
       // This assumes the center is 0,0
1554
       // This assumes the center is 0,0
1555
       #if ENABLED(DELTA)
1555
       #if ENABLED(DELTA)
1556
         if (axis != Z_AXIS) {
1556
         if (axis != Z_AXIS) {
1557
-          max = sqrt(sq(DELTA_PRINTABLE_RADIUS) - sq(current_position[Y_AXIS - axis]));
1557
+          max = sqrt(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis]));
1558
           min = -max;
1558
           min = -max;
1559
         }
1559
         }
1560
       #endif
1560
       #endif

Loading…
Cancel
Save