Browse Source

Minor code cleanup, move NUM_AXIS out of config

Scott Lahteine 9 years ago
parent
commit
e0d4368cb5

+ 4
- 2
Marlin/Configuration.h View File

@@ -529,8 +529,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
529 529
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
530 530
 #endif
531 531
 
532
-//// MOVEMENT SETTINGS
533
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
532
+/**
533
+ * MOVEMENT SETTINGS
534
+ */
535
+
534 536
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
535 537
 
536 538
 // default settings

+ 29
- 16
Marlin/Marlin.h View File

@@ -93,18 +93,15 @@ void serial_echopair_P(const char *s_P, double v);
93 93
 void serial_echopair_P(const char *s_P, unsigned long v);
94 94
 
95 95
 
96
-//Things to write to serial from Program memory. Saves 400 to 2k of RAM.
97
-FORCE_INLINE void serialprintPGM(const char *str)
98
-{
99
-  char ch=pgm_read_byte(str);
100
-  while(ch)
101
-  {
96
+// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
97
+FORCE_INLINE void serialprintPGM(const char *str) {
98
+  char ch = pgm_read_byte(str);
99
+  while(ch) {
102 100
     MYSERIAL.write(ch);
103
-    ch=pgm_read_byte(++str);
101
+    ch = pgm_read_byte(++str);
104 102
   }
105 103
 }
106 104
 
107
-
108 105
 void get_command();
109 106
 void process_commands();
110 107
 
@@ -148,7 +145,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
148 145
 #endif
149 146
 
150 147
 #if HAS_E0_ENABLE
151
-  #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON)
148
+  #define enable_e0()  E0_ENABLE_WRITE( E_ENABLE_ON)
152 149
   #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
153 150
 #else
154 151
   #define enable_e0()  /* nothing */
@@ -156,7 +153,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
156 153
 #endif
157 154
 
158 155
 #if (EXTRUDERS > 1) && HAS_E1_ENABLE
159
-  #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON)
156
+  #define enable_e1()  E1_ENABLE_WRITE( E_ENABLE_ON)
160 157
   #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
161 158
 #else
162 159
   #define enable_e1()  /* nothing */
@@ -164,7 +161,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
164 161
 #endif
165 162
 
166 163
 #if (EXTRUDERS > 2) && HAS_E2_ENABLE
167
-  #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON)
164
+  #define enable_e2()  E2_ENABLE_WRITE( E_ENABLE_ON)
168 165
   #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
169 166
 #else
170 167
   #define enable_e2()  /* nothing */
@@ -172,15 +169,25 @@ void manage_inactivity(bool ignore_stepper_queue=false);
172 169
 #endif
173 170
 
174 171
 #if (EXTRUDERS > 3) && HAS_E3_ENABLE
175
-  #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON)
172
+  #define enable_e3()  E3_ENABLE_WRITE( E_ENABLE_ON)
176 173
   #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
177 174
 #else
178 175
   #define enable_e3()  /* nothing */
179 176
   #define disable_e3() /* nothing */
180 177
 #endif
181 178
 
179
+/**
180
+ * The axis order in all axis related arrays is X, Y, Z, E
181
+ */
182
+#define NUM_AXIS 4
183
+
184
+/**
185
+ * Axis indices as enumerated constants
186
+ *
187
+ * A_AXIS and B_AXIS are used by COREXY printers
188
+ * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
189
+ */
182 190
 enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
183
-//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
184 191
 
185 192
 void FlushSerialRequestResend();
186 193
 void ClearToSend();
@@ -224,7 +231,7 @@ void refresh_cmd_timeout(void);
224 231
 #ifndef CRITICAL_SECTION_START
225 232
   #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
226 233
   #define CRITICAL_SECTION_END    SREG = _sreg;
227
-#endif //CRITICAL_SECTION_START
234
+#endif
228 235
 
229 236
 extern float homing_feedrate[];
230 237
 extern bool axis_relative_modes[];
@@ -233,8 +240,9 @@ extern bool volumetric_enabled;
233 240
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
234 241
 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.
235 242
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
236
-extern float current_position[NUM_AXIS] ;
243
+extern float current_position[NUM_AXIS];
237 244
 extern float home_offset[3];
245
+
238 246
 #ifdef DELTA
239 247
   extern float endstop_adj[3];
240 248
   extern float delta_radius;
@@ -242,18 +250,23 @@ extern float home_offset[3];
242 250
   extern float delta_segments_per_second;
243 251
   void recalc_delta_settings(float radius, float diagonal_rod);
244 252
 #elif defined(Z_DUAL_ENDSTOPS)
245
-extern float z_endstop_adj;
253
+  extern float z_endstop_adj;
246 254
 #endif
255
+
247 256
 #ifdef SCARA
248 257
   extern float axis_scaling[3];  // Build size scaling
249 258
 #endif
259
+
250 260
 extern float min_pos[3];
251 261
 extern float max_pos[3];
252 262
 extern bool axis_known_position[3];
263
+
253 264
 #ifdef ENABLE_AUTO_BED_LEVELING
254 265
   extern float zprobe_zoffset;
255 266
 #endif
267
+
256 268
 extern int fanSpeed;
269
+
257 270
 #ifdef BARICUDA
258 271
   extern int ValvePressure;
259 272
   extern int EtoPPressure;

+ 4
- 2
Marlin/configurator/config/Configuration.h View File

@@ -553,8 +553,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
553 553
 
554 554
 // @section movement
555 555
 
556
-//// MOVEMENT SETTINGS
557
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
556
+/**
557
+ * MOVEMENT SETTINGS
558
+ */
559
+
558 560
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
559 561
 
560 562
 // default settings

+ 4
- 2
Marlin/example_configurations/Felix/Configuration.h View File

@@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
499 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
500 500
 #endif
501 501
 
502
-//// MOVEMENT SETTINGS
503
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
504 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
505 507
 
506 508
 // default settings

+ 4
- 2
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
499 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
500 500
 #endif
501 501
 
502
-//// MOVEMENT SETTINGS
503
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
504 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
505 507
 
506 508
 // default settings

+ 4
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -522,8 +522,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
522 522
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
523 523
 #endif
524 524
 
525
-//// MOVEMENT SETTINGS
526
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
525
+/**
526
+ * MOVEMENT SETTINGS
527
+ */
528
+
527 529
 #define HOMING_FEEDRATE {2000, 2000, 150, 0}  // set the homing speeds (mm/min)
528 530
 
529 531
 // default settings

+ 4
- 2
Marlin/example_configurations/K8200/Configuration.h View File

@@ -527,8 +527,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
527 527
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
528 528
 #endif
529 529
 
530
-//// MOVEMENT SETTINGS
531
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
530
+/**
531
+ * MOVEMENT SETTINGS
532
+ */
533
+
532 534
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
533 535
 
534 536
 // default settings

+ 4
- 2
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -551,8 +551,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
551 551
   #define MANUAL_Z_HOME_POS 0.1  // Distance between nozzle and print surface after homing.
552 552
 #endif
553 553
 
554
-//// MOVEMENT SETTINGS
555
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
554
+/**
555
+ * MOVEMENT SETTINGS
556
+ */
557
+
556 558
 #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0}  // set the homing speeds (mm/min)
557 559
 
558 560
 // default settings

+ 4
- 2
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
521 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
522 522
 #endif
523 523
 
524
-//// MOVEMENT SETTINGS
525
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
526 528
 #define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0}  // set the homing speeds (mm/min)
527 529
 
528 530
 // default settings

+ 4
- 2
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -566,8 +566,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
566 566
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
567 567
 #endif
568 568
 
569
-//// MOVEMENT SETTINGS
570
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
569
+/**
570
+ * MOVEMENT SETTINGS
571
+ */
572
+
571 573
 
572 574
 // delta homing speeds must be the same on xyz
573 575
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

+ 4
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -570,8 +570,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
570 570
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
571 571
 #endif
572 572
 
573
-//// MOVEMENT SETTINGS
574
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
573
+/**
574
+ * MOVEMENT SETTINGS
575
+ */
576
+
575 577
 
576 578
 // delta homing speeds must be the same on xyz
577 579
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

+ 4
- 2
Marlin/example_configurations/makibox/Configuration.h View File

@@ -519,8 +519,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
519 519
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
520 520
 #endif
521 521
 
522
-//// MOVEMENT SETTINGS
523
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
522
+/**
523
+ * MOVEMENT SETTINGS
524
+ */
525
+
524 526
 #define HOMING_FEEDRATE {1500, 1500, 120, 0}  // set the homing speeds (mm/min)   ***** MakiBox A6 *****
525 527
 
526 528
 // default settings

+ 4
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
521 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
522 522
 #endif
523 523
 
524
-//// MOVEMENT SETTINGS
525
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
526 528
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
527 529
 
528 530
 // default settings

+ 3
- 3
Marlin/planner.cpp View File

@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
614 614
         #if EXTRUDERS > 1
615 615
           case 1:
616 616
             enable_e1();
617
-            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
617
+            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
618 618
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
619 619
             #if EXTRUDERS > 2
620 620
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -626,7 +626,7 @@ float junction_deviation = 0.1;
626 626
           #if EXTRUDERS > 2
627 627
             case 2:
628 628
               enable_e2();
629
-              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
629
+              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2;
630 630
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
631 631
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
632 632
               #if EXTRUDERS > 3
@@ -636,7 +636,7 @@ float junction_deviation = 0.1;
636 636
             #if EXTRUDERS > 3
637 637
               case 3:
638 638
                 enable_e3();
639
-                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2;
639
+                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2;
640 640
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
641 641
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
642 642
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();

Loading…
Cancel
Save