Kaynağa Gözat

Move G5 to cpp

Scott Lahteine 7 yıl önce
ebeveyn
işleme
56f4a43535

+ 0
- 8
Marlin/src/Marlin.cpp Dosyayı Görüntüle

@@ -225,10 +225,6 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
225 225
  * ***************************************************************************
226 226
  */
227 227
 
228
-#if ENABLED(BEZIER_CURVE_SUPPORT)
229
-  void plan_cubic_move(const float offset[4]);
230
-#endif
231
-
232 228
 #if ENABLED(DIGIPOT_I2C)
233 229
   extern void digipot_i2c_set_current(uint8_t channel, float current);
234 230
   extern void digipot_i2c_init();
@@ -365,10 +361,6 @@ void suicide() {
365 361
  ***************** GCode Handlers *****************
366 362
  **************************************************/
367 363
 
368
-#if ENABLED(BEZIER_CURVE_SUPPORT)
369
-  #include "gcode/motion/G5.h"
370
-#endif
371
-
372 364
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
373 365
   #include "gcode/feature/clean/G12.h"
374 366
 #endif

+ 1
- 2
Marlin/src/gcode/gcode.cpp Dosyayı Görüntüle

@@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) {
112 112
 //
113 113
 // Placeholders for non-migrated codes
114 114
 //
115
-extern void gcode_G5();
116 115
 extern void gcode_G12();
117 116
 extern void gcode_G17();
118 117
 extern void gcode_G18();
@@ -299,7 +298,7 @@ void GcodeSuite::process_next_command() {
299 298
 
300 299
       #if ENABLED(BEZIER_CURVE_SUPPORT)
301 300
         case 5: // G5: Cubic B_spline
302
-          gcode_G5();
301
+          G5();
303 302
           break;
304 303
       #endif // BEZIER_CURVE_SUPPORT
305 304
 

Marlin/src/gcode/motion/G5.h → Marlin/src/gcode/motion/G5.cpp Dosyayı Görüntüle

@@ -20,8 +20,12 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(BEZIER_CURVE_SUPPORT)
26
+
27
+#include "../../module/motion.h"
23 28
 #include "../../module/planner_bezier.h"
24
-#include "../../gcode/gcode.h"
25 29
 
26 30
 void plan_cubic_move(const float offset[4]) {
27 31
   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]) {
39 43
  * parameters can be omitted and default to zero.
40 44
  */
41 45
 
46
+#include "../gcode.h"
47
+#include "../../Marlin.h" // for IsRunning()
48
+
42 49
 /**
43 50
  * G5: Cubic B-spline
44 51
  */
45
-void gcode_G5() {
52
+void GcodeSuite::G5() {
46 53
   if (IsRunning()) {
47 54
 
48 55
     #if ENABLED(CNC_WORKSPACE_PLANES)
@@ -53,7 +60,7 @@ void gcode_G5() {
53 60
       }
54 61
     #endif
55 62
 
56
-    gcode.get_destination_from_command();
63
+    get_destination_from_command();
57 64
 
58 65
     const float offset[] = {
59 66
       parser.linearval('I'),
@@ -65,3 +72,5 @@ void gcode_G5() {
65 72
     plan_cubic_move(offset);
66 73
   }
67 74
 }
75
+
76
+#endif // BEZIER_CURVE_SUPPORT

Loading…
İptal
Kaydet