diff --git a/gcode.c b/gcode.c index aa16d0c..7b31552 100644 --- a/gcode.c +++ b/gcode.c @@ -371,7 +371,11 @@ uint8_t gc_execute_line(char *line) FAIL(STATUS_INVALID_STATEMENT); break; } + #ifdef USE_LINE_NUMBERS if(mc_probe_cycle(target, (gc.inverse_feed_rate_mode) ? inverse_feed_rate : gc.feed_rate, gc.inverse_feed_rate_mode, line_number)){ + #else + if(mc_probe_cycle(target, (gc.inverse_feed_rate_mode) ? inverse_feed_rate : gc.feed_rate, gc.inverse_feed_rate_mode)){ + #endif FAIL(STATUS_PROBE_ERROR); } axis_words = 0; @@ -381,7 +385,11 @@ uint8_t gc_execute_line(char *line) FAIL(STATUS_INVALID_STATEMENT); break; } + #ifdef USE_LINE_NUMBERS mc_probe_cycle(target, (gc.inverse_feed_rate_mode) ? inverse_feed_rate : gc.feed_rate, gc.inverse_feed_rate_mode, line_number); + #else + mc_probe_cycle(target, (gc.inverse_feed_rate_mode) ? inverse_feed_rate : gc.feed_rate, gc.inverse_feed_rate_mode); + #endif axis_words = 0; break; case NON_MODAL_SET_HOME_0: case NON_MODAL_SET_HOME_1: diff --git a/motion_control.c b/motion_control.c index cd79d97..00d2423 100644 --- a/motion_control.c +++ b/motion_control.c @@ -269,7 +269,12 @@ void mc_homing_cycle() limits_init(); } + +#ifdef USE_LINE_NUMBERS uint8_t mc_probe_cycle(float *t, float feed_rate, uint8_t invert_feed_rate, int32_t line_number) +#else +uint8_t mc_probe_cycle(float *t, float feed_rate, uint8_t invert_feed_rate) +#endif { protocol_buffer_synchronize(); //finish all queued commands @@ -290,7 +295,12 @@ uint8_t mc_probe_cycle(float *t, float feed_rate, uint8_t invert_feed_rate, int3 // An empty buffer is needed because we need to enable the probe pin along the same move that we're about to execute. sys.state = STATE_CYCLE; + + #ifdef USE_LINE_NUMBERS plan_buffer_line(target, feed_rate, invert_feed_rate, line_number); // Bypass mc_line(). Directly plan homing motion. + #else + plan_buffer_line(target, feed_rate, invert_feed_rate); // Bypass mc_line(). Directly plan homing motion. + #endif st_prep_buffer(); // Prep and fill segment buffer from newly planned block. st_wake_up(); // Initiate motion @@ -341,7 +351,11 @@ uint8_t mc_probe_cycle(float *t, float feed_rate, uint8_t invert_feed_rate, int3 //report_realtime_status(); //debug - plan_buffer_line(target, feed_rate, invert_feed_rate, line_number); // Bypass mc_line(). Directly plan motion. + #ifdef USE_LINE_NUMBERS + plan_buffer_line(target, feed_rate, invert_feed_rate, line_number); // Bypass mc_line(). Directly plan homing motion. + #else + plan_buffer_line(target, feed_rate, invert_feed_rate); // Bypass mc_line(). Directly plan homing motion. + #endif st_prep_buffer(); // Prep and fill segment buffer from newly planned block. st_wake_up(); // Initiate motion diff --git a/motion_control.h b/motion_control.h index f8af924..4956487 100644 --- a/motion_control.h +++ b/motion_control.h @@ -54,7 +54,11 @@ void mc_homing_cycle(); // Perform tool length probe cycle. Requires probe switch. // Returns STATUS_OK in all cases except when the motion is completed without the probe being triggered. // In that case, it returns a STATUS_PROBE_ERROR +#ifdef USE_LINE_NUMBERS uint8_t mc_probe_cycle(float *target, float feed_rate, uint8_t invert_feed_rate, int32_t line_number); +#else +uint8_t mc_probe_cycle(float *target, float feed_rate, uint8_t invert_feed_rate); +#endif // Performs system reset. If in motion state, kills all motion and sets system alarm. void mc_reset();