ソースを参照

Merge pull request #4993 from thinkyhead/rc_planner_deps

Sort out some header dependencies
Scott Lahteine 8年前
コミット
d2da14459f
6個のファイルの変更56行の追加56行の削除
  1. 0
    5
      Marlin/Marlin.h
  2. 34
    27
      Marlin/Marlin_main.cpp
  3. 0
    1
      Marlin/cardreader.cpp
  4. 11
    18
      Marlin/planner.h
  5. 4
    4
      Marlin/temperature.h
  6. 7
    1
      Marlin/ultralcd.cpp

+ 0
- 5
Marlin/Marlin.h ファイルの表示

@@ -394,11 +394,6 @@ extern uint8_t active_extruder;
394 394
 
395 395
 void calculate_volumetric_multipliers();
396 396
 
397
-// Buzzer
398
-#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
399
-  #include "buzzer.h"
400
-#endif
401
-
402 397
 /**
403 398
  * Blocking movement and shorthand functions
404 399
  */

+ 34
- 27
Marlin/Marlin_main.cpp ファイルの表示

@@ -33,20 +33,6 @@
33 33
 
34 34
 #include "Marlin.h"
35 35
 
36
-#if HAS_ABL
37
-  #include "vector_3.h"
38
-#endif
39
-
40
-#if ENABLED(AUTO_BED_LEVELING_LINEAR)
41
-  #include "qr_solve.h"
42
-#elif ENABLED(MESH_BED_LEVELING)
43
-  #include "mesh_bed_leveling.h"
44
-#endif
45
-
46
-#if ENABLED(BEZIER_CURVE_SUPPORT)
47
-  #include "planner_bezier.h"
48
-#endif
49
-
50 36
 #include "ultralcd.h"
51 37
 #include "planner.h"
52 38
 #include "stepper.h"
@@ -61,6 +47,23 @@
61 47
 #include "duration_t.h"
62 48
 #include "types.h"
63 49
 
50
+#if HAS_ABL
51
+  #include "vector_3.h"
52
+  #if ENABLED(AUTO_BED_LEVELING_LINEAR)
53
+    #include "qr_solve.h"
54
+  #endif
55
+#elif ENABLED(MESH_BED_LEVELING)
56
+  #include "mesh_bed_leveling.h"
57
+#endif
58
+
59
+#if ENABLED(BEZIER_CURVE_SUPPORT)
60
+  #include "planner_bezier.h"
61
+#endif
62
+
63
+#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
64
+  #include "buzzer.h"
65
+#endif
66
+
64 67
 #if ENABLED(USE_WATCHDOG)
65 68
   #include "watchdog.h"
66 69
 #endif
@@ -457,13 +460,17 @@ static uint8_t target_extruder;
457 460
 #endif
458 461
 
459 462
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
460
-  #define ADJUST_DELTA(V) \
461
-    if (planner.abl_enabled) { \
462
-      const float zadj = bilinear_z_offset(V); \
463
-      delta[A_AXIS] += zadj; \
464
-      delta[B_AXIS] += zadj; \
465
-      delta[C_AXIS] += zadj; \
466
-    }
463
+  #if ENABLED(DELTA)
464
+    #define ADJUST_DELTA(V) \
465
+      if (planner.abl_enabled) { \
466
+        const float zadj = bilinear_z_offset(V); \
467
+        delta[A_AXIS] += zadj; \
468
+        delta[B_AXIS] += zadj; \
469
+        delta[C_AXIS] += zadj; \
470
+      }
471
+  #else
472
+    #define ADJUST_DELTA(V) if (planner.abl_enabled) { delta[Z_AXIS] += bilinear_z_offset(V); }
473
+  #endif
467 474
 #elif IS_KINEMATIC
468 475
   #define ADJUST_DELTA(V) NOOP
469 476
 #endif
@@ -2218,8 +2225,8 @@ static void clean_up_after_endstop_or_probe_move() {
2218 2225
     #elif HAS_ABL
2219 2226
 
2220 2227
       if (enable != planner.abl_enabled) {
2221
-        planner.abl_enabled = !planner.abl_enabled;
2222
-        if (!planner.abl_enabled)
2228
+        planner.abl_enabled = enable;
2229
+        if (!enable)
2223 2230
           set_current_from_steppers_for_axis(
2224 2231
             #if ABL_PLANAR
2225 2232
               ALL_AXES
@@ -4560,7 +4567,9 @@ inline void gcode_M31() {
4560 4567
   SERIAL_ECHO_START;
4561 4568
   SERIAL_ECHOLNPAIR("Print time: ", buffer);
4562 4569
 
4563
-  thermalManager.autotempShutdown();
4570
+  #if ENABLED(AUTOTEMP)
4571
+    thermalManager.autotempShutdown();
4572
+  #endif
4564 4573
 }
4565 4574
 
4566 4575
 #if ENABLED(SDSUPPORT)
@@ -8814,9 +8823,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
8814 8823
       // For non-interpolated delta calculate every segment
8815 8824
       for (uint16_t s = segments + 1; --s;) {
8816 8825
         DELTA_NEXT(segment_distance[i]);
8817
-        DELTA_IK();
8818
-        ADJUST_DELTA(DELTA_VAR);
8819
-        planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], DELTA_VAR[E_AXIS], _feedrate_mm_s, active_extruder);
8826
+        planner.buffer_line_kinematic(DELTA_VAR, _feedrate_mm_s, active_extruder);
8820 8827
       }
8821 8828
 
8822 8829
     #endif

+ 0
- 1
Marlin/cardreader.cpp ファイルの表示

@@ -24,7 +24,6 @@
24 24
 
25 25
 #include "ultralcd.h"
26 26
 #include "stepper.h"
27
-#include "temperature.h"
28 27
 #include "language.h"
29 28
 
30 29
 #include "Marlin.h"

+ 11
- 18
Marlin/planner.h ファイルの表示

@@ -34,21 +34,12 @@
34 34
 
35 35
 #include "types.h"
36 36
 #include "enum.h"
37
-#include "MarlinConfig.h"
37
+#include "Marlin.h"
38 38
 
39 39
 #if HAS_ABL
40 40
   #include "vector_3.h"
41 41
 #endif
42 42
 
43
-class Planner;
44
-extern Planner planner;
45
-
46
-#if IS_KINEMATIC
47
-  // for inline buffer_line_kinematic
48
-  extern float delta[ABC];
49
-  void inverse_kinematics(const float logical[XYZ]);
50
-#endif
51
-
52 43
 /**
53 44
  * struct block_t
54 45
  *
@@ -207,17 +198,11 @@ class Planner {
207 198
 
208 199
     static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); }
209 200
 
210
-    #if HAS_ABL || ENABLED(MESH_BED_LEVELING)
201
+    #if PLANNER_LEVELING
202
+
211 203
       #define ARG_X float lx
212 204
       #define ARG_Y float ly
213 205
       #define ARG_Z float lz
214
-    #else
215
-      #define ARG_X const float &lx
216
-      #define ARG_Y const float &ly
217
-      #define ARG_Z const float &lz
218
-    #endif
219
-
220
-    #if PLANNER_LEVELING
221 206
 
222 207
       /**
223 208
        * Apply leveling to transform a cartesian position
@@ -227,6 +212,12 @@ class Planner {
227 212
       static void apply_leveling(float logical[XYZ]) { apply_leveling(logical[X_AXIS], logical[Y_AXIS], logical[Z_AXIS]); }
228 213
       static void unapply_leveling(float logical[XYZ]);
229 214
 
215
+    #else
216
+
217
+      #define ARG_X const float &lx
218
+      #define ARG_Y const float &ly
219
+      #define ARG_Z const float &lz
220
+
230 221
     #endif
231 222
 
232 223
     /**
@@ -402,4 +393,6 @@ class Planner {
402 393
 
403 394
 };
404 395
 
396
+extern Planner planner;
397
+
405 398
 #endif // PLANNER_H

+ 4
- 4
Marlin/temperature.h ファイルの表示

@@ -372,15 +372,15 @@ class Temperature {
372 372
      */
373 373
     static void updatePID();
374 374
 
375
-    static void autotempShutdown() {
376
-      #if ENABLED(AUTOTEMP)
375
+    #if ENABLED(AUTOTEMP)
376
+      static void autotempShutdown() {
377 377
         if (planner.autotemp_enabled) {
378 378
           planner.autotemp_enabled = false;
379 379
           if (degTargetHotend(EXTRUDER_IDX) > planner.autotemp_min)
380 380
             setTargetHotend(0, EXTRUDER_IDX);
381 381
         }
382
-      #endif
383
-    }
382
+      }
383
+    #endif
384 384
 
385 385
     #if ENABLED(BABYSTEPPING)
386 386
 

+ 7
- 1
Marlin/ultralcd.cpp ファイルの表示

@@ -30,6 +30,10 @@
30 30
 #include "configuration_store.h"
31 31
 #include "utility.h"
32 32
 
33
+#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
34
+  #include "buzzer.h"
35
+#endif
36
+
33 37
 #if ENABLED(BLTOUCH)
34 38
   #include "endstops.h"
35 39
 #endif
@@ -581,7 +585,9 @@ void kill_screen(const char* lcd_msg) {
581 585
       clear_command_queue();
582 586
       quickstop_stepper();
583 587
       print_job_timer.stop();
584
-      thermalManager.autotempShutdown();
588
+      #if ENABLED(AUTOTEMP)
589
+        thermalManager.autotempShutdown();
590
+      #endif
585 591
       wait_for_heatup = false;
586 592
       lcd_setstatus(MSG_PRINT_ABORTED, true);
587 593
     }

読み込み中…
キャンセル
保存