Browse Source

Merge Cleanup (PR#2445)

Richard Wackerbarth 9 years ago
parent
commit
e0f4fc2033
2 changed files with 29 additions and 33 deletions
  1. 25
    29
      Marlin/Marlin.h
  2. 4
    4
      Marlin/temperature.cpp

+ 25
- 29
Marlin/Marlin.h View File

@@ -206,18 +206,6 @@ void disable_all_steppers();
206 206
 void FlushSerialRequestResend();
207 207
 void ok_to_send();
208 208
 
209
-#ifdef DELTA
210
-  void calculate_delta(float cartesian[3]);
211
-  #ifdef ENABLE_AUTO_BED_LEVELING
212
-    extern int delta_grid_spacing[2];
213
-    void adjust_delta(float cartesian[3]);
214
-  #endif
215
-  extern float delta[3];
216
-#endif
217
-#ifdef SCARA
218
-  void calculate_delta(float cartesian[3]);
219
-  void calculate_SCARA_forward_Transform(float f_scara[3]);
220
-#endif
221 209
 void reset_bed_level();
222 210
 void prepare_move();
223 211
 void kill(const char *);
@@ -269,25 +257,33 @@ extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in p
269 257
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
270 258
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
271 259
 extern float current_position[NUM_AXIS];
272
-extern float home_offset[3];
273
-
274
-#ifdef DELTA
275
-  extern float endstop_adj[3];
276
-  extern float delta_radius;
277
-  extern float delta_diagonal_rod;
278
-  extern float delta_segments_per_second;
279
-  void recalc_delta_settings(float radius, float diagonal_rod);
280
-#elif defined(Z_DUAL_ENDSTOPS)
281
-  extern float z_endstop_adj;
282
-#endif
260
+extern float home_offset[3]; // axis[n].home_offset
261
+extern float min_pos[3]; // axis[n].min_pos
262
+extern float max_pos[3]; // axis[n].max_pos
263
+extern bool axis_known_position[3]; // axis[n].is_known
283 264
 
284
-#ifdef SCARA
285
-  extern float axis_scaling[3];  // Build size scaling
265
+#if defined(DELTA) || defined(SCARA)
266
+  void calculate_delta(float cartesian[3]);
267
+  #ifdef DELTA
268
+    extern float delta[3];
269
+    extern float endstop_adj[3]; // axis[n].endstop_adj
270
+    extern float delta_radius;
271
+    extern float delta_diagonal_rod;
272
+    extern float delta_segments_per_second;
273
+    void recalc_delta_settings(float radius, float diagonal_rod);
274
+    #ifdef ENABLE_AUTO_BED_LEVELING
275
+      extern int delta_grid_spacing[2];
276
+      void adjust_delta(float cartesian[3]);
277
+    #endif
278
+  #elif defined(SCARA)
279
+    extern float axis_scaling[3];  // Build size scaling
280
+    void calculate_SCARA_forward_Transform(float f_scara[3]);
281
+  #endif
286 282
 #endif
287 283
 
288
-extern float min_pos[3];
289
-extern float max_pos[3];
290
-extern bool axis_known_position[3];
284
+#ifdef Z_DUAL_ENDSTOPS
285
+  extern float z_endstop_adj;
286
+#endif
291 287
 
292 288
 #ifdef ENABLE_AUTO_BED_LEVELING
293 289
   extern float zprobe_zoffset;
@@ -320,7 +316,7 @@ extern int fanSpeed;
320 316
 
321 317
 #ifdef FWRETRACT
322 318
   extern bool autoretract_enabled;
323
-  extern bool retracted[EXTRUDERS];
319
+  extern bool retracted[EXTRUDERS]; // extruder[n].retracted
324 320
   extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
325 321
   extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
326 322
 #endif

+ 4
- 4
Marlin/temperature.cpp View File

@@ -80,7 +80,7 @@ unsigned char soft_pwm_bed;
80 80
     static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
81 81
     static millis_t thermal_runaway_timer[4]; // = {0,0,0,0};
82 82
   #endif
83
-  #ifdef THERMAL_PROTECTION_BED
83
+  #if defined(THERMAL_PROTECTION_BED) && TEMP_SENSOR_BED != 0
84 84
     static TRState thermal_runaway_bed_state_machine = TRReset;
85 85
     static millis_t thermal_runaway_bed_timer;
86 86
   #endif
@@ -1550,7 +1550,7 @@ ISR(TIMER0_COMPB_vect) {
1550 1550
       if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0);
1551 1551
     #endif
1552 1552
 
1553
-    #if HAS_TEMP_1
1553
+    #if HAS_TEMP_1 && EXTRUDERS > 1
1554 1554
       #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
1555 1555
         #define GE1 <=
1556 1556
       #else
@@ -1560,7 +1560,7 @@ ISR(TIMER0_COMPB_vect) {
1560 1560
       if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1);
1561 1561
     #endif // TEMP_SENSOR_1
1562 1562
 
1563
-    #if HAS_TEMP_2
1563
+    #if HAS_TEMP_2 && EXTRUDERS > 2
1564 1564
       #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
1565 1565
         #define GE2 <=
1566 1566
       #else
@@ -1570,7 +1570,7 @@ ISR(TIMER0_COMPB_vect) {
1570 1570
       if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2);
1571 1571
     #endif // TEMP_SENSOR_2
1572 1572
 
1573
-    #if HAS_TEMP_3
1573
+    #if HAS_TEMP_3 && EXTRUDERS > 3
1574 1574
       #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP
1575 1575
         #define GE3 <=
1576 1576
       #else

Loading…
Cancel
Save