From: Daid Date: Wed, 29 Feb 2012 10:38:12 +0000 (+0100) Subject: Made plan_buffer_line arguments const, which optimizes better and fixes the RUNOUT_PR... X-Git-Tag: iwj-success-2012-07-29~77^2~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=88d289caa1950ee7022720ba791aeded7cbb102f;p=marlin.git Made plan_buffer_line arguments const, which optimizes better and fixes the RUNOUT_PREVENTION feature. --- diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 00fead1..b1e1d2b 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -441,7 +441,7 @@ float junction_deviation = 0.1; // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration // calculation the caller must also provide the physical length of the line in millimeters. -void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder) +void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder) { // Calculate the buffer head after we push this byte int next_buffer_head = next_block_index(block_buffer_head); diff --git a/Marlin/planner.h b/Marlin/planner.h index c90581b..ac9719f 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -67,7 +67,7 @@ void plan_init(); // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in // millimaters. Feed rate specifies the speed of the motion. -void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder); +void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder); // Set position. Used for G92 instructions. void plan_set_position(const float &x, const float &y, const float &z, const float &e);