Browse Source

Use binary OR with endstop bits

Scott Lahteine 8 years ago
parent
commit
644c376e84
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/stepper.cpp

+ 2
- 2
Marlin/stepper.cpp View File

@@ -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…
Cancel
Save