Browse Source

Move G5 to cpp

Scott Lahteine 7 years ago
parent
commit
56f4a43535
3 changed files with 13 additions and 13 deletions
  1. 0
    8
      Marlin/src/Marlin.cpp
  2. 1
    2
      Marlin/src/gcode/gcode.cpp
  3. 12
    3
      Marlin/src/gcode/motion/G5.cpp

+ 0
- 8
Marlin/src/Marlin.cpp View File

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
 #if ENABLED(DIGIPOT_I2C)
228
 #if ENABLED(DIGIPOT_I2C)
233
   extern void digipot_i2c_set_current(uint8_t channel, float current);
229
   extern void digipot_i2c_set_current(uint8_t channel, float current);
234
   extern void digipot_i2c_init();
230
   extern void digipot_i2c_init();
365
  ***************** GCode Handlers *****************
361
  ***************** GCode Handlers *****************
366
  **************************************************/
362
  **************************************************/
367
 
363
 
368
-#if ENABLED(BEZIER_CURVE_SUPPORT)
369
-  #include "gcode/motion/G5.h"
370
-#endif
371
-
372
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
364
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
373
   #include "gcode/feature/clean/G12.h"
365
   #include "gcode/feature/clean/G12.h"
374
 #endif
366
 #endif

+ 1
- 2
Marlin/src/gcode/gcode.cpp View File

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

Marlin/src/gcode/motion/G5.h → Marlin/src/gcode/motion/G5.cpp View File

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
 #include "../../module/planner_bezier.h"
28
 #include "../../module/planner_bezier.h"
24
-#include "../../gcode/gcode.h"
25
 
29
 
26
 void plan_cubic_move(const float offset[4]) {
30
 void plan_cubic_move(const float offset[4]) {
27
   cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder);
31
   cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder);
39
  * parameters can be omitted and default to zero.
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
  * G5: Cubic B-spline
50
  * G5: Cubic B-spline
44
  */
51
  */
45
-void gcode_G5() {
52
+void GcodeSuite::G5() {
46
   if (IsRunning()) {
53
   if (IsRunning()) {
47
 
54
 
48
     #if ENABLED(CNC_WORKSPACE_PLANES)
55
     #if ENABLED(CNC_WORKSPACE_PLANES)
53
       }
60
       }
54
     #endif
61
     #endif
55
 
62
 
56
-    gcode.get_destination_from_command();
63
+    get_destination_from_command();
57
 
64
 
58
     const float offset[] = {
65
     const float offset[] = {
59
       parser.linearval('I'),
66
       parser.linearval('I'),
65
     plan_cubic_move(offset);
72
     plan_cubic_move(offset);
66
   }
73
   }
67
 }
74
 }
75
+
76
+#endif // BEZIER_CURVE_SUPPORT

Loading…
Cancel
Save