瀏覽代碼

Use binary OR with endstop bits

Scott Lahteine 9 年之前
父節點
當前提交
644c376e84
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      Marlin/stepper.cpp

+ 2
- 2
Marlin/stepper.cpp 查看文件

@@ -399,7 +399,7 @@ inline void update_endstops() {
399 399
               COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
400 400
             #endif
401 401
 
402
-            byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2
402
+            byte z_test = TEST_ENDSTOP(Z_MIN) | (TEST_ENDSTOP(Z2_MIN) << 1); // bit 0 for Z, bit 1 for Z2
403 403
 
404 404
             if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
405 405
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
@@ -435,7 +435,7 @@ inline void update_endstops() {
435 435
               COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX);
436 436
             #endif
437 437
 
438
-            byte z_test = TEST_ENDSTOP(Z_MAX) << 0 + TEST_ENDSTOP(Z2_MAX) << 1; // bit 0 for Z, bit 1 for Z2
438
+            byte z_test = TEST_ENDSTOP(Z_MAX) | (TEST_ENDSTOP(Z2_MAX) << 1); // bit 0 for Z, bit 1 for Z2
439 439
 
440 440
             if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
441 441
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];

Loading…
取消
儲存