Преглед изворни кода

Merge pull request #1805 from thinkyhead/fixup_probing

Optimize coordinate copying, fix EXTRUDER_RUNOUT_PREVENT
Scott Lahteine пре 10 година
родитељ
комит
41ded7e996

+ 1
- 1
Marlin/Configuration.h Прегледај датотеку

503
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
503
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
504
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
504
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
505
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
505
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
506
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
506
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
507
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
507
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
508
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
508
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
509
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
509
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/Marlin.h Прегледај датотеку

227
 void prepare_arc_move(char isclockwise);
227
 void prepare_arc_move(char isclockwise);
228
 void clamp_to_software_endstops(float target[3]);
228
 void clamp_to_software_endstops(float target[3]);
229
 
229
 
230
-void refresh_cmd_timeout(void);
230
+void refresh_cmd_timeout();
231
 
231
 
232
 #ifdef FAST_PWM_FAN
232
 #ifdef FAST_PWM_FAN
233
   void setPwmFrequency(uint8_t pin, int val);
233
   void setPwmFrequency(uint8_t pin, int val);

+ 2
- 3
Marlin/MarlinSerial.cpp Прегледај датотеку

287
 #endif // !AT90USB
287
 #endif // !AT90USB
288
 
288
 
289
 // For AT90USB targets use the UART for BT interfacing
289
 // For AT90USB targets use the UART for BT interfacing
290
-#if defined(AT90USB) && defined (BTENABLED)
291
-   HardwareSerial bt;
290
+#if defined(AT90USB) && defined(BTENABLED)
291
+  HardwareSerial bt;
292
 #endif
292
 #endif
293
-

+ 2
- 2
Marlin/MarlinSerial.h Прегледај датотеку

153
 #endif // !AT90USB
153
 #endif // !AT90USB
154
 
154
 
155
 // Use the UART for BT in AT90USB configurations
155
 // Use the UART for BT in AT90USB configurations
156
-#if defined(AT90USB) && defined (BTENABLED)
157
-   extern HardwareSerial bt;
156
+#if defined(AT90USB) && defined(BTENABLED)
157
+  extern HardwareSerial bt;
158
 #endif
158
 #endif
159
 
159
 
160
 #endif
160
 #endif

+ 119
- 80
Marlin/Marlin_main.cpp Прегледај датотеку

1009
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1009
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1010
   }
1010
   }
1011
 #endif
1011
 #endif
1012
+inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1013
+inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1012
 
1014
 
1013
 #ifdef ENABLE_AUTO_BED_LEVELING
1015
 #ifdef ENABLE_AUTO_BED_LEVELING
1014
 
1016
 
1020
       refresh_cmd_timeout();
1022
       refresh_cmd_timeout();
1021
       calculate_delta(destination);
1023
       calculate_delta(destination);
1022
       plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
1024
       plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
1023
-      for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i];
1025
+      set_current_to_destination();
1024
     }
1026
     }
1025
   #endif
1027
   #endif
1026
 
1028
 
1564
 
1566
 
1565
     float oldFeedrate = feedrate;
1567
     float oldFeedrate = feedrate;
1566
 
1568
 
1567
-    for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i];
1569
+    set_destination_to_current();
1568
 
1570
 
1569
     if (retracting) {
1571
     if (retracting) {
1570
 
1572
 
1769
 
1771
 
1770
   enable_endstops(true);
1772
   enable_endstops(true);
1771
 
1773
 
1772
-  for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; // includes E_AXIS
1774
+  set_destination_to_current();
1773
 
1775
 
1774
   feedrate = 0.0;
1776
   feedrate = 0.0;
1775
 
1777
 
1997
     if (mbl_was_active) {
1999
     if (mbl_was_active) {
1998
       current_position[X_AXIS] = mbl.get_x(0);
2000
       current_position[X_AXIS] = mbl.get_x(0);
1999
       current_position[Y_AXIS] = mbl.get_y(0);
2001
       current_position[Y_AXIS] = mbl.get_y(0);
2000
-      for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i];
2002
+      set_destination_to_current();
2001
       feedrate = homing_feedrate[X_AXIS];
2003
       feedrate = homing_feedrate[X_AXIS];
2002
       line_to_destination();
2004
       line_to_destination();
2003
       st_synchronize();
2005
       st_synchronize();
2776
 
2778
 
2777
 #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST)
2779
 #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST)
2778
 
2780
 
2779
-  // This is redudant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity.
2781
+  // This is redundant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity.
2780
   #ifdef Z_PROBE_ENDSTOP
2782
   #ifdef Z_PROBE_ENDSTOP
2781
     #if !HAS_Z_PROBE
2783
     #if !HAS_Z_PROBE
2782
-      #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability."
2784
+      #error You must define Z_PROBE_PIN to enable Z-Probe repeatability calculation.
2783
     #endif
2785
     #endif
2784
   #elif !HAS_Z_MIN
2786
   #elif !HAS_Z_MIN
2785
-    #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability."
2787
+    #error You must define Z_MIN_PIN to enable Z-Probe repeatability calculation.
2786
   #endif
2788
   #endif
2787
 
2789
 
2788
   /**
2790
   /**
4613
     #if EXTRUDERS > 1
4615
     #if EXTRUDERS > 1
4614
       if (tmp_extruder != active_extruder) {
4616
       if (tmp_extruder != active_extruder) {
4615
         // Save current position to return to after applying extruder offset
4617
         // Save current position to return to after applying extruder offset
4616
-        memcpy(destination, current_position, sizeof(destination));
4618
+        set_destination_to_current();
4617
         #ifdef DUAL_X_CARRIAGE
4619
         #ifdef DUAL_X_CARRIAGE
4618
           if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
4620
           if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
4619
                 (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder))) {
4621
                 (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder))) {
5338
 {
5340
 {
5339
   if (!mbl.active) {
5341
   if (!mbl.active) {
5340
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5342
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5341
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5342
-      current_position[i] = destination[i];
5343
-    }
5343
+    set_current_to_destination();
5344
     return;
5344
     return;
5345
   }
5345
   }
5346
   int pix = mbl.select_x_index(current_position[X_AXIS]);
5346
   int pix = mbl.select_x_index(current_position[X_AXIS]);
5354
   if (pix == ix && piy == iy) {
5354
   if (pix == ix && piy == iy) {
5355
     // Start and end on same mesh square
5355
     // Start and end on same mesh square
5356
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5356
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5357
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5358
-      current_position[i] = destination[i];
5359
-    }
5357
+    set_current_to_destination();
5360
     return;
5358
     return;
5361
   }
5359
   }
5362
   float nx, ny, ne, normalized_dist;
5360
   float nx, ny, ne, normalized_dist;
5387
   } else {
5385
   } else {
5388
     // Already split on a border
5386
     // Already split on a border
5389
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5387
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5390
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5391
-      current_position[i] = destination[i];
5392
-    }
5388
+    set_current_to_destination();
5393
     return;
5389
     return;
5394
   }
5390
   }
5395
   // Do the split and look for more borders
5391
   // Do the split and look for more borders
5477
 
5473
 
5478
   #endif // DELTA
5474
   #endif // DELTA
5479
 
5475
 
5480
-#ifdef DUAL_X_CARRIAGE
5481
-  if (active_extruder_parked)
5482
-  {
5483
-    if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0)
5484
-    {
5485
-      // move duplicate extruder into correct duplication position.
5486
-      plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
5487
-      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
5488
-          current_position[E_AXIS], max_feedrate[X_AXIS], 1);
5489
-      sync_plan_position();
5490
-      st_synchronize();
5491
-      extruder_duplication_enabled = true;
5492
-      active_extruder_parked = false;
5493
-    }
5494
-    else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
5495
-    {
5496
-      if (current_position[E_AXIS] == destination[E_AXIS])
5497
-      {
5498
-        // this is a travel move - skit it but keep track of current position (so that it can later
5499
-        // be used as start of first non-travel move)
5500
-        if (delayed_move_time != 0xFFFFFFFFUL)
5501
-        {
5502
-          memcpy(current_position, destination, sizeof(current_position));
5503
-          if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
5504
-            raised_parked_position[Z_AXIS] = destination[Z_AXIS];
5505
-          delayed_move_time = millis();
5506
-          return;
5476
+  #ifdef DUAL_X_CARRIAGE
5477
+    if (active_extruder_parked) {
5478
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
5479
+        // move duplicate extruder into correct duplication position.
5480
+        plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
5481
+        plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
5482
+            current_position[E_AXIS], max_feedrate[X_AXIS], 1);
5483
+        sync_plan_position();
5484
+        st_synchronize();
5485
+        extruder_duplication_enabled = true;
5486
+        active_extruder_parked = false;
5487
+      }
5488
+      else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) { // handle unparking of head
5489
+        if (current_position[E_AXIS] == destination[E_AXIS]) {
5490
+          // this is a travel move - skit it but keep track of current position (so that it can later
5491
+          // be used as start of first non-travel move)
5492
+          if (delayed_move_time != 0xFFFFFFFFUL) {
5493
+            set_current_to_destination();
5494
+            if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
5495
+              raised_parked_position[Z_AXIS] = destination[Z_AXIS];
5496
+            delayed_move_time = millis();
5497
+            return;
5498
+          }
5507
         }
5499
         }
5500
+        delayed_move_time = 0;
5501
+        // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
5502
+        plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5503
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
5504
+            current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
5505
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
5506
+            current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5507
+        active_extruder_parked = false;
5508
       }
5508
       }
5509
-      delayed_move_time = 0;
5510
-      // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
5511
-      plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5512
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
5513
-          current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
5514
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
5515
-          current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5516
-      active_extruder_parked = false;
5517
     }
5509
     }
5518
-  }
5519
-#endif //DUAL_X_CARRIAGE
5510
+  #endif // DUAL_X_CARRIAGE
5520
 
5511
 
5521
-#if !defined(DELTA) && !defined(SCARA)
5522
-  // Do not use feedmultiply for E or Z only moves
5523
-  if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
5524
-    line_to_destination();
5525
-  } else {
5526
-#ifdef MESH_BED_LEVELING
5527
-    mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5528
-    return;
5529
-#else
5530
-    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5531
-#endif  // MESH_BED_LEVELING
5532
-  }
5533
-#endif // !(DELTA || SCARA)
5512
+  #if !defined(DELTA) && !defined(SCARA)
5513
+    // Do not use feedmultiply for E or Z only moves
5514
+    if ( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
5515
+      line_to_destination();
5516
+    }
5517
+    else {
5518
+      #ifdef MESH_BED_LEVELING
5519
+        mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5520
+        return;
5521
+      #else
5522
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5523
+      #endif  // MESH_BED_LEVELING
5524
+    }
5525
+  #endif // !(DELTA || SCARA)
5534
 
5526
 
5535
-  for(int8_t i=0; i < NUM_AXIS; i++) {
5536
-    current_position[i] = destination[i];
5537
-  }
5527
+  set_current_to_destination();
5538
 }
5528
 }
5539
 
5529
 
5540
 void prepare_arc_move(char isclockwise) {
5530
 void prepare_arc_move(char isclockwise) {
5546
   // As far as the parser is concerned, the position is now == target. In reality the
5536
   // As far as the parser is concerned, the position is now == target. In reality the
5547
   // motion control system might still be processing the action and the real tool position
5537
   // motion control system might still be processing the action and the real tool position
5548
   // in any intermediate location.
5538
   // in any intermediate location.
5549
-  for(int8_t i=0; i < NUM_AXIS; i++) {
5550
-    current_position[i] = destination[i];
5551
-  }
5539
+  set_current_to_destination();
5552
   refresh_cmd_timeout();
5540
   refresh_cmd_timeout();
5553
 }
5541
 }
5554
 
5542
 
5718
 }
5706
 }
5719
 
5707
 
5720
 /**
5708
 /**
5721
- * 
5709
+ * Manage several activities:
5710
+ *  - Check for Filament Runout
5711
+ *  - Keep the command buffer full
5712
+ *  - Check for maximum inactive time between commands
5713
+ *  - Check for maximum inactive time between stepper commands
5714
+ *  - Check if pin CHDK needs to go LOW
5715
+ *  - Check for KILL button held down
5716
+ *  - Check for HOME button held down
5717
+ *  - Check if cooling fan needs to be switched on
5718
+ *  - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
5722
  */
5719
  */
5723
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5720
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5724
   
5721
   
5737
       && !ignore_stepper_queue && !blocks_queued())
5734
       && !ignore_stepper_queue && !blocks_queued())
5738
     disable_all_steppers();
5735
     disable_all_steppers();
5739
 
5736
 
5740
-  #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
5737
+  #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH
5741
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
5738
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
5742
       chdkActive = false;
5739
       chdkActive = false;
5743
       WRITE(CHDK, LOW);
5740
       WRITE(CHDK, LOW);
5780
   #endif
5777
   #endif
5781
     
5778
     
5782
   #if HAS_CONTROLLERFAN
5779
   #if HAS_CONTROLLERFAN
5783
-    controllerFan(); //Check if fan should be turned on to cool stepper drivers down
5780
+    controllerFan(); // Check if fan should be turned on to cool stepper drivers down
5784
   #endif
5781
   #endif
5785
 
5782
 
5786
   #ifdef EXTRUDER_RUNOUT_PREVENT
5783
   #ifdef EXTRUDER_RUNOUT_PREVENT
5787
     if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000)
5784
     if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000)
5788
     if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
5785
     if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
5789
-      bool oldstatus = E0_ENABLE_READ;
5790
-      enable_e0();
5786
+      bool oldstatus;
5787
+      switch(active_extruder) {
5788
+        case 0:
5789
+          oldstatus = E0_ENABLE_READ;
5790
+          enable_e0();
5791
+          break;
5792
+        #if EXTRUDERS > 1
5793
+          case 1:
5794
+            oldstatus = E1_ENABLE_READ;
5795
+            enable_e1();
5796
+            break;
5797
+          #if EXTRUDERS > 2
5798
+            case 2:
5799
+              oldstatus = E2_ENABLE_READ;
5800
+              enable_e2();
5801
+              break;
5802
+            #if EXTRUDERS > 3
5803
+              case 3:
5804
+                oldstatus = E3_ENABLE_READ;
5805
+                enable_e3();
5806
+                break;
5807
+            #endif
5808
+          #endif
5809
+        #endif
5810
+      }
5791
       float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
5811
       float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
5792
       plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
5812
       plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
5793
                       destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
5813
                       destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
5797
       plan_set_e_position(oldepos);
5817
       plan_set_e_position(oldepos);
5798
       previous_millis_cmd = ms; // refresh_cmd_timeout()
5818
       previous_millis_cmd = ms; // refresh_cmd_timeout()
5799
       st_synchronize();
5819
       st_synchronize();
5800
-      E0_ENABLE_WRITE(oldstatus);
5820
+      switch(active_extruder) {
5821
+        case 0:
5822
+          E0_ENABLE_WRITE(oldstatus);
5823
+          break;
5824
+        #if EXTRUDERS > 1
5825
+          case 1:
5826
+            E1_ENABLE_WRITE(oldstatus);
5827
+            break;
5828
+          #if EXTRUDERS > 2
5829
+            case 2:
5830
+              E2_ENABLE_WRITE(oldstatus);
5831
+              break;
5832
+            #if EXTRUDERS > 3
5833
+              case 3:
5834
+                E3_ENABLE_WRITE(oldstatus);
5835
+                break;
5836
+            #endif
5837
+          #endif
5838
+        #endif
5839
+      }
5801
     }
5840
     }
5802
   #endif
5841
   #endif
5803
 
5842
 
5806
     if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) {
5845
     if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) {
5807
       // travel moves have been received so enact them
5846
       // travel moves have been received so enact them
5808
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
5847
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
5809
-      memcpy(destination, current_position, sizeof(destination));
5848
+      set_destination_to_current();
5810
       prepare_move();
5849
       prepare_move();
5811
     }
5850
     }
5812
   #endif
5851
   #endif

+ 1
- 1
Marlin/SanityCheck.h Прегледај датотеку

100
      * Require a Z Min pin
100
      * Require a Z Min pin
101
      */
101
      */
102
     #if Z_MIN_PIN == -1
102
     #if Z_MIN_PIN == -1
103
-      #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
103
+      #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
104
         #ifdef Z_PROBE_REPEATABILITY_TEST
104
         #ifdef Z_PROBE_REPEATABILITY_TEST
105
           #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
105
           #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
106
         #else
106
         #else

+ 1
- 1
Marlin/Servo.h Прегледај датотеку

123
     int read();                        // returns current pulse width as an angle between 0 and 180 degrees
123
     int read();                        // returns current pulse width as an angle between 0 and 180 degrees
124
     int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
124
     int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
125
     bool attached();                   // return true if this servo is attached, otherwise false
125
     bool attached();                   // return true if this servo is attached, otherwise false
126
-    #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
126
+    #if defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0
127
       int pin;                           // store the hardware pin of the servo
127
       int pin;                           // store the hardware pin of the servo
128
     #endif
128
     #endif
129
   private:
129
   private:

+ 1
- 1
Marlin/configurator/config/Configuration.h Прегледај датотеку

523
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
523
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
524
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
524
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
525
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
525
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
526
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
526
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
527
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
527
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
528
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
528
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
529
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
529
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h Прегледај датотеку

473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
476
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h Прегледај датотеку

473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
476
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h Прегледај датотеку

496
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
497
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
498
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
499
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
500
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
501
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
502
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
502
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/K8200/Configuration.h Прегледај датотеку

501
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
501
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
502
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
502
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
503
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
503
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
504
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
504
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
505
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
505
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
506
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
506
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
507
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
507
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h Прегледај датотеку

525
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
525
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
526
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
526
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
527
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
527
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
528
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
528
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
529
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
529
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
530
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
530
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
531
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
531
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h Прегледај датотеку

495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
498
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h Прегледај датотеку

541
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
541
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
542
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
542
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
543
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
543
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
544
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
544
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
545
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
545
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
546
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
546
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
547
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
547
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Прегледај датотеку

545
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
545
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
546
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
546
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
547
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
547
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
548
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
548
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
549
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
549
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
550
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
550
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
551
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
551
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h Прегледај датотеку

493
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
493
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
494
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
494
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
495
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
495
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
496
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
496
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
497
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
497
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
498
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
498
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
499
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
499
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h Прегледај датотеку

495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
498
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 5
- 5
Marlin/fastio.h Прегледај датотеку

91
 	added as necessary or if I feel like it- not a comprehensive list!
91
 	added as necessary or if I feel like it- not a comprehensive list!
92
 */
92
 */
93
 
93
 
94
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
94
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
95
 // UART
95
 // UART
96
 #define	RXD					DIO0
96
 #define	RXD					DIO0
97
 #define	TXD					DIO1
97
 #define	TXD					DIO1
426
 #define PD7_PWM			NULL
426
 #define PD7_PWM			NULL
427
 #endif	/*	_AVR_ATmega{168,328,328P}__ */
427
 #endif	/*	_AVR_ATmega{168,328,328P}__ */
428
 
428
 
429
-#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined (__AVR_ATmega1284P__)
429
+#if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
430
 // UART
430
 // UART
431
 #define	RXD					DIO8
431
 #define	RXD					DIO8
432
 #define	TXD					DIO9
432
 #define	TXD					DIO9
929
 #define PD7_PWM			OCR2A
929
 #define PD7_PWM			OCR2A
930
 #endif	/*	_AVR_ATmega{644,644P,644PA}__ */
930
 #endif	/*	_AVR_ATmega{644,644P,644PA}__ */
931
 
931
 
932
-#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
932
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
933
 // UART
933
 // UART
934
 #define	RXD					DIO0
934
 #define	RXD					DIO0
935
 #define	TXD					DIO1
935
 #define	TXD					DIO1
2024
 
2024
 
2025
 #endif
2025
 #endif
2026
 
2026
 
2027
-#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2027
+#if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2028
 // SPI
2028
 // SPI
2029
 #define	SCK					DIO9
2029
 #define	SCK					DIO9
2030
 #define	MISO				DIO11
2030
 #define	MISO				DIO11
3322
 #endif // __AVR_AT90usbxxx__
3322
 #endif // __AVR_AT90usbxxx__
3323
 
3323
 
3324
 
3324
 
3325
-#if defined (__AVR_ATmega1281__) || defined (__AVR_ATmega2561__)
3325
+#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
3326
 // UART
3326
 // UART
3327
 #define	RXD					DIO0
3327
 #define	RXD					DIO0
3328
 #define	TXD					DIO1
3328
 #define	TXD					DIO1

+ 6
- 3
Marlin/pins.h Прегледај датотеку

187
   #define Z_MIN_PIN          -1
187
   #define Z_MIN_PIN          -1
188
 #endif
188
 #endif
189
 
189
 
190
-#if defined (DISABLE_Z_PROBE_ENDSTOP) || ! defined (Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
190
+#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
191
   #define Z_PROBE_PIN        -1
191
   #define Z_PROBE_PIN        -1
192
 #endif
192
 #endif
193
 
193
 
220
   #define Z_MIN_PIN          -1
220
   #define Z_MIN_PIN          -1
221
 #endif
221
 #endif
222
 
222
 
223
-#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, PS_ON_PIN, \
224
-                        HEATER_BED_PIN, FAN_PIN, \
223
+#define SENSITIVE_PINS { 0, 1, \
224
+                        X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
225
+                        Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
226
+                        Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, \
227
+                        PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \
225
                         _E0_PINS _E1_PINS _E2_PINS _E3_PINS \
228
                         _E0_PINS _E1_PINS _E2_PINS _E3_PINS \
226
                         analogInputToDigitalPin(TEMP_BED_PIN) \
229
                         analogInputToDigitalPin(TEMP_BED_PIN) \
227
                        }
230
                        }

+ 3
- 3
Marlin/pins_RAMPS_13.h Прегледај датотеку

62
   #define FILWIDTH_PIN        5
62
   #define FILWIDTH_PIN        5
63
 #endif
63
 #endif
64
 
64
 
65
-#if defined(Z_PROBE_ENDSTOP)
65
+#ifdef Z_PROBE_ENDSTOP
66
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
66
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
67
- #define Z_PROBE_PIN 32
67
+  #define Z_PROBE_PIN 32
68
 #endif
68
 #endif
69
 
69
 
70
-#if defined(FILAMENT_RUNOUT_SENSOR)
70
+#ifdef FILAMENT_RUNOUT_SENSOR
71
   // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
71
   // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
72
   #define FILRUNOUT_PIN        4
72
   #define FILRUNOUT_PIN        4
73
 #endif
73
 #endif

Loading…
Откажи
Сачувај