Skip to content

Commit

Permalink
optimisation: remove 1 more call to __divsf3
Browse files Browse the repository at this point in the history
Changing (feedrate * feedmultiply) / 6000.f
to (feedrate * feedmultiply) * (1.f / 6000.f)

Replaces the call to __divsf3 with __mulsf3 which is better

No change in memory
  • Loading branch information
gudnimg authored and DRracer committed Apr 23, 2024
1 parent 2c46e1b commit 28502a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) / 6000.f, r, isclockwise, start_segment_idx);
mc_arc(current_position, destination, offset, (feedrate * feedmultiply) * (1.f / 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.
Expand Down

0 comments on commit 28502a2

Please sign in to comment.