optimisation: remove 3 calls to __divsf3

Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2024-02-02 19:24:43 +00:00 committed by DRracer
parent d22245b482
commit 2c46e1b344
2 changed files with 2 additions and 2 deletions

View File

@ -9574,7 +9574,7 @@ void prepare_move(uint16_t start_segment_idx)
void prepare_arc_move(bool isclockwise, uint16_t start_segment_idx) {
float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc
// Trace the arc
mc_arc(current_position, destination, offset, feedrate * feedmultiply / 60 / 100.0, r, isclockwise, start_segment_idx);
mc_arc(current_position, destination, offset, (feedrate * feedmultiply) / 6000.f, r, isclockwise, start_segment_idx);
// As far as the parser is concerned, the position is now == target. In reality the
// motion control system might still be processing the action and the real tool position
// in any intermediate location.

View File

@ -56,7 +56,7 @@ void mc_arc(const float* position, float* target, const float* offset, float fee
if (cs.arc_segments_per_sec > 0)
{
// 20200417 - FormerLurker - Implement MIN_ARC_SEGMENTS if it is defined - from Marlin 2.0 implementation
float mm_per_arc_segment_sec = (feed_rate / 60.0f) * (1.0f / cs.arc_segments_per_sec);
float mm_per_arc_segment_sec = feed_rate / (60.f * float(cs.arc_segments_per_sec));
if (mm_per_arc_segment_sec < mm_per_arc_segment)
mm_per_arc_segment = mm_per_arc_segment_sec;
}