浏览代码

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

Bernhard Kubicek 13 年前
父节点
当前提交
d41547a397
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. 12
    0
      Marlin/Marlin.pde
  2. 1
    1
      Marlin/planner.h

+ 12
- 0
Marlin/Marlin.pde 查看文件

1035
 
1035
 
1036
 void prepare_move()
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
   plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
1050
   plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
1039
   for(int8_t i=0; i < NUM_AXIS; i++) {
1051
   for(int8_t i=0; i < NUM_AXIS; i++) {
1040
     current_position[i] = destination[i];
1052
     current_position[i] = destination[i];

+ 1
- 1
Marlin/planner.h 查看文件

31
 typedef struct {
31
 typedef struct {
32
   // Fields used by the bresenham algorithm for tracing the line
32
   // Fields used by the bresenham algorithm for tracing the line
33
   long steps_x, steps_y, steps_z, steps_e;  // Step count along each axis
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
   long accelerate_until;                    // The index of the step event on which to stop acceleration
35
   long accelerate_until;                    // The index of the step event on which to stop acceleration
36
   long decelerate_after;                    // The index of the step event on which to start decelerating
36
   long decelerate_after;                    // The index of the step event on which to start decelerating
37
   long acceleration_rate;                   // The acceleration rate used for acceleration calculation
37
   long acceleration_rate;                   // The acceleration rate used for acceleration calculation

正在加载...
取消
保存