Merge commit 'cd71a90ce8a770e0030ed6c9bac805b89724e275' into dev

Conflicts:
	limits.c
	motion_control.c
	report.c
This commit is contained in:
Robert Grzesek
2014-02-18 18:23:39 -08:00
8 changed files with 97 additions and 68 deletions

View File

@ -39,7 +39,7 @@
// segments, must pass through this routine before being passed to the planner. The seperation of
// mc_line and plan_buffer_line is done primarily to place non-planner-type functions from being
// in the planner and to let backlash compensation or canned cycle integration simple and direct.
void mc_line(float *target, float feed_rate, uint8_t invert_feed_rate)
void mc_line(float *target, float feed_rate, uint8_t invert_feed_rate, uint32_t line_number)
{
// If enabled, check for soft limit violations. Placed here all line motions are picked up
// from everywhere in Grbl.
@ -68,7 +68,7 @@ void mc_line(float *target, float feed_rate, uint8_t invert_feed_rate)
else { break; }
} while (1);
plan_buffer_line(target, feed_rate, invert_feed_rate);
plan_buffer_line(target, feed_rate, invert_feed_rate, line_number);
// If idle, indicate to the system there is now a planned block in the buffer ready to cycle
// start. Otherwise ignore and continue on.
@ -84,7 +84,7 @@ void mc_line(float *target, float feed_rate, uint8_t invert_feed_rate)
// of each segment is configured in settings.arc_tolerance, which is defined to be the maximum normal
// distance from segment to the circle when the end points both lie on the circle.
void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8_t axis_1,
uint8_t axis_linear, float feed_rate, uint8_t invert_feed_rate, float radius, uint8_t isclockwise)
uint8_t axis_linear, float feed_rate, uint8_t invert_feed_rate, float radius, uint8_t isclockwise, uint32_t line_number)
{
float center_axis0 = position[axis_0] + offset[axis_0];
float center_axis1 = position[axis_1] + offset[axis_1];
@ -180,14 +180,14 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
arc_target[axis_0] = center_axis0 + r_axis0;
arc_target[axis_1] = center_axis1 + r_axis1;
arc_target[axis_linear] += linear_per_segment;
mc_line(arc_target, feed_rate, invert_feed_rate);
mc_line(arc_target, feed_rate, invert_feed_rate, line_number);
// Bail mid-circle on system abort. Runtime command check already performed by mc_line.
if (sys.abort) { return; }
}
}
// Ensure last segment arrives at target location.
mc_line(target, feed_rate, invert_feed_rate);
mc_line(target, feed_rate, invert_feed_rate, line_number);
}
@ -225,16 +225,16 @@ void mc_homing_cycle()
#ifdef HOMING_CYCLE_2
limits_go_home(HOMING_CYCLE_2); // Homing cycle 2
#endif
protocol_execute_runtime(); // Check for reset and set system abort.
if (sys.abort) { return; } // Did not complete. Alarm state set by mc_alarm.
// Homing cycle complete! Setup system for normal operation.
// -------------------------------------------------------------------------------------
// Gcode parser position was circumvented by the limits_go_home() routine, so sync position now.
gc_sync_position();
// Set idle state after homing completes and before returning to main program.
sys.state = STATE_IDLE;
st_go_idle(); // Set idle state after homing completes