Bladeren bron

Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into Marlin_v1

Bernhard Kubicek 13 jaren geleden
bovenliggende
commit
d41547a397
2 gewijzigde bestanden met toevoegingen van 13 en 1 verwijderingen
  1. 12
    0
      Marlin/Marlin.pde
  2. 1
    1
      Marlin/planner.h

+ 12
- 0
Marlin/Marlin.pde Bestand weergeven

@@ -1035,6 +1035,18 @@ inline void get_arc_coordinates()
1035 1035
 
1036 1036
 void prepare_move()
1037 1037
 {
1038
+  if (min_software_endstops) {
1039
+    if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0;
1040
+    if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0;
1041
+    if (destination[Z_AXIS] < 0) destination[Z_AXIS] = 0.0;
1042
+  }
1043
+
1044
+  if (max_software_endstops) {
1045
+    if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH;
1046
+    if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH;
1047
+    if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH;
1048
+  }
1049
+
1038 1050
   plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
1039 1051
   for(int8_t i=0; i < NUM_AXIS; i++) {
1040 1052
     current_position[i] = destination[i];

+ 1
- 1
Marlin/planner.h Bestand weergeven

@@ -31,7 +31,7 @@
31 31
 typedef struct {
32 32
   // Fields used by the bresenham algorithm for tracing the line
33 33
   long steps_x, steps_y, steps_z, steps_e;  // Step count along each axis
34
-  long step_event_count;                    // The number of step events required to complete this block
34
+  unsigned long step_event_count;           // The number of step events required to complete this block
35 35
   long accelerate_until;                    // The index of the step event on which to stop acceleration
36 36
   long decelerate_after;                    // The index of the step event on which to start decelerating
37 37
   long acceleration_rate;                   // The acceleration rate used for acceleration calculation

Laden…
Annuleren
Opslaan