Use binary OR with endstop bits
This commit is contained in:
parent
54a39d8c1a
commit
644c376e84
|
@ -399,7 +399,7 @@ inline void update_endstops() {
|
||||||
COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
|
COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2
|
byte z_test = TEST_ENDSTOP(Z_MIN) | (TEST_ENDSTOP(Z2_MIN) << 1); // bit 0 for Z, bit 1 for Z2
|
||||||
|
|
||||||
if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
|
if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
|
||||||
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
||||||
|
@ -435,7 +435,7 @@ inline void update_endstops() {
|
||||||
COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX);
|
COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
byte z_test = TEST_ENDSTOP(Z_MAX) << 0 + TEST_ENDSTOP(Z2_MAX) << 1; // bit 0 for Z, bit 1 for Z2
|
byte z_test = TEST_ENDSTOP(Z_MAX) | (TEST_ENDSTOP(Z2_MAX) << 1); // bit 0 for Z, bit 1 for Z2
|
||||||
|
|
||||||
if (z_test && current_block->steps[Z_AXIS] > 0) { // t_test = Z_MAX || Z2_MAX
|
if (z_test && current_block->steps[Z_AXIS] > 0) { // t_test = Z_MAX || Z2_MAX
|
||||||
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
||||||
|
|
Loading…
Reference in a new issue