瀏覽代碼

Cast int to AxisEnum for some accessors

Scott Lahteine 8 年之前
父節點
當前提交
0c79553fc5
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      Marlin/Marlin_main.cpp

+ 3
- 3
Marlin/Marlin_main.cpp 查看文件

1449
     if (axis == X_AXIS || axis == Y_AXIS) {
1449
     if (axis == X_AXIS || axis == Y_AXIS) {
1450
 
1450
 
1451
       float homeposition[XYZ];
1451
       float homeposition[XYZ];
1452
-      LOOP_XYZ(i) homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i);
1452
+      LOOP_XYZ(i) homeposition[i] = LOGICAL_POSITION(base_home_pos((AxisEnum)i), i);
1453
 
1453
 
1454
       // SERIAL_ECHOPAIR("homeposition X:", homeposition[X_AXIS]);
1454
       // SERIAL_ECHOPAIR("homeposition X:", homeposition[X_AXIS]);
1455
       // SERIAL_ECHOLNPAIR(" Y:", homeposition[Y_AXIS]);
1455
       // SERIAL_ECHOLNPAIR(" Y:", homeposition[Y_AXIS]);
4283
     float retract_mm[XYZ];
4283
     float retract_mm[XYZ];
4284
     LOOP_XYZ(i) {
4284
     LOOP_XYZ(i) {
4285
       float dist = destination[i] - current_position[i];
4285
       float dist = destination[i] - current_position[i];
4286
-      retract_mm[i] = fabs(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm(i) * (dist > 0 ? -1 : 1);
4286
+      retract_mm[i] = fabs(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1);
4287
     }
4287
     }
4288
 
4288
 
4289
     stepper.synchronize();  // wait until the machine is idle
4289
     stepper.synchronize();  // wait until the machine is idle
6666
   bool err = false;
6666
   bool err = false;
6667
   LOOP_XYZ(i) {
6667
   LOOP_XYZ(i) {
6668
     if (axis_homed[i]) {
6668
     if (axis_homed[i]) {
6669
-      float base = (current_position[i] > (soft_endstop_min[i] + soft_endstop_max[i]) * 0.5) ? base_home_pos(i) : 0,
6669
+      float base = (current_position[i] > (soft_endstop_min[i] + soft_endstop_max[i]) * 0.5) ? base_home_pos((AxisEnum)i) : 0,
6670
             diff = current_position[i] - LOGICAL_POSITION(base, i);
6670
             diff = current_position[i] - LOGICAL_POSITION(base, i);
6671
       if (diff > -20 && diff < 20) {
6671
       if (diff > -20 && diff < 20) {
6672
         set_home_offset((AxisEnum)i, home_offset[i] - diff);
6672
         set_home_offset((AxisEnum)i, home_offset[i] - diff);

Loading…
取消
儲存