Move G5 to cpp

2.0.x
Scott Lahteine 7 years ago
parent 760f29a88e
commit 56f4a43535

@ -225,10 +225,6 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
* *************************************************************************** * ***************************************************************************
*/ */
#if ENABLED(BEZIER_CURVE_SUPPORT)
void plan_cubic_move(const float offset[4]);
#endif
#if ENABLED(DIGIPOT_I2C) #if ENABLED(DIGIPOT_I2C)
extern void digipot_i2c_set_current(uint8_t channel, float current); extern void digipot_i2c_set_current(uint8_t channel, float current);
extern void digipot_i2c_init(); extern void digipot_i2c_init();
@ -365,10 +361,6 @@ void suicide() {
***************** GCode Handlers ***************** ***************** GCode Handlers *****************
**************************************************/ **************************************************/
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "gcode/motion/G5.h"
#endif
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
#include "gcode/feature/clean/G12.h" #include "gcode/feature/clean/G12.h"
#endif #endif

@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_G5();
extern void gcode_G12(); extern void gcode_G12();
extern void gcode_G17(); extern void gcode_G17();
extern void gcode_G18(); extern void gcode_G18();
@ -299,7 +298,7 @@ void GcodeSuite::process_next_command() {
#if ENABLED(BEZIER_CURVE_SUPPORT) #if ENABLED(BEZIER_CURVE_SUPPORT)
case 5: // G5: Cubic B_spline case 5: // G5: Cubic B_spline
gcode_G5(); G5();
break; break;
#endif // BEZIER_CURVE_SUPPORT #endif // BEZIER_CURVE_SUPPORT

@ -20,8 +20,12 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "../../module/motion.h"
#include "../../module/planner_bezier.h" #include "../../module/planner_bezier.h"
#include "../../gcode/gcode.h"
void plan_cubic_move(const float offset[4]) { void plan_cubic_move(const float offset[4]) {
cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder); cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder);
@ -39,10 +43,13 @@ void plan_cubic_move(const float offset[4]) {
* parameters can be omitted and default to zero. * parameters can be omitted and default to zero.
*/ */
#include "../gcode.h"
#include "../../Marlin.h" // for IsRunning()
/** /**
* G5: Cubic B-spline * G5: Cubic B-spline
*/ */
void gcode_G5() { void GcodeSuite::G5() {
if (IsRunning()) { if (IsRunning()) {
#if ENABLED(CNC_WORKSPACE_PLANES) #if ENABLED(CNC_WORKSPACE_PLANES)
@ -53,7 +60,7 @@ void gcode_G5() {
} }
#endif #endif
gcode.get_destination_from_command(); get_destination_from_command();
const float offset[] = { const float offset[] = {
parser.linearval('I'), parser.linearval('I'),
@ -65,3 +72,5 @@ void gcode_G5() {
plan_cubic_move(offset); plan_cubic_move(offset);
} }
} }
#endif // BEZIER_CURVE_SUPPORT
Loading…
Cancel
Save