소스 검색

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
 
394
 
395
 void calculate_volumetric_multipliers();
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
  * Blocking movement and shorthand functions
398
  * Blocking movement and shorthand functions
404
  */
399
  */

+ 34
- 27
Marlin/Marlin_main.cpp 파일 보기

33
 
33
 
34
 #include "Marlin.h"
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
 #include "ultralcd.h"
36
 #include "ultralcd.h"
51
 #include "planner.h"
37
 #include "planner.h"
52
 #include "stepper.h"
38
 #include "stepper.h"
61
 #include "duration_t.h"
47
 #include "duration_t.h"
62
 #include "types.h"
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
 #if ENABLED(USE_WATCHDOG)
67
 #if ENABLED(USE_WATCHDOG)
65
   #include "watchdog.h"
68
   #include "watchdog.h"
66
 #endif
69
 #endif
457
 #endif
460
 #endif
458
 
461
 
459
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
 #elif IS_KINEMATIC
474
 #elif IS_KINEMATIC
468
   #define ADJUST_DELTA(V) NOOP
475
   #define ADJUST_DELTA(V) NOOP
469
 #endif
476
 #endif
2218
     #elif HAS_ABL
2225
     #elif HAS_ABL
2219
 
2226
 
2220
       if (enable != planner.abl_enabled) {
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
           set_current_from_steppers_for_axis(
2230
           set_current_from_steppers_for_axis(
2224
             #if ABL_PLANAR
2231
             #if ABL_PLANAR
2225
               ALL_AXES
2232
               ALL_AXES
4560
   SERIAL_ECHO_START;
4567
   SERIAL_ECHO_START;
4561
   SERIAL_ECHOLNPAIR("Print time: ", buffer);
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
 #if ENABLED(SDSUPPORT)
4575
 #if ENABLED(SDSUPPORT)
8814
       // For non-interpolated delta calculate every segment
8823
       // For non-interpolated delta calculate every segment
8815
       for (uint16_t s = segments + 1; --s;) {
8824
       for (uint16_t s = segments + 1; --s;) {
8816
         DELTA_NEXT(segment_distance[i]);
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
     #endif
8829
     #endif

+ 0
- 1
Marlin/cardreader.cpp 파일 보기

24
 
24
 
25
 #include "ultralcd.h"
25
 #include "ultralcd.h"
26
 #include "stepper.h"
26
 #include "stepper.h"
27
-#include "temperature.h"
28
 #include "language.h"
27
 #include "language.h"
29
 
28
 
30
 #include "Marlin.h"
29
 #include "Marlin.h"

+ 11
- 18
Marlin/planner.h 파일 보기

34
 
34
 
35
 #include "types.h"
35
 #include "types.h"
36
 #include "enum.h"
36
 #include "enum.h"
37
-#include "MarlinConfig.h"
37
+#include "Marlin.h"
38
 
38
 
39
 #if HAS_ABL
39
 #if HAS_ABL
40
   #include "vector_3.h"
40
   #include "vector_3.h"
41
 #endif
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
  * struct block_t
44
  * struct block_t
54
  *
45
  *
207
 
198
 
208
     static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); }
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
       #define ARG_X float lx
203
       #define ARG_X float lx
212
       #define ARG_Y float ly
204
       #define ARG_Y float ly
213
       #define ARG_Z float lz
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
        * Apply leveling to transform a cartesian position
208
        * Apply leveling to transform a cartesian position
227
       static void apply_leveling(float logical[XYZ]) { apply_leveling(logical[X_AXIS], logical[Y_AXIS], logical[Z_AXIS]); }
212
       static void apply_leveling(float logical[XYZ]) { apply_leveling(logical[X_AXIS], logical[Y_AXIS], logical[Z_AXIS]); }
228
       static void unapply_leveling(float logical[XYZ]);
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
     #endif
221
     #endif
231
 
222
 
232
     /**
223
     /**
402
 
393
 
403
 };
394
 };
404
 
395
 
396
+extern Planner planner;
397
+
405
 #endif // PLANNER_H
398
 #endif // PLANNER_H

+ 4
- 4
Marlin/temperature.h 파일 보기

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

+ 7
- 1
Marlin/ultralcd.cpp 파일 보기

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

Loading…
취소
저장