Skip to content

Commit

Permalink
Merge pull request #207 from Paciente8159/fix-pr205
Browse files Browse the repository at this point in the history
fixed logic ORING of signals when homing leading to incorrect trigger when self-squaring cause by #205
  • Loading branch information
Paciente8159 authored May 9, 2022
2 parents 6a7b25b + 5a2f6e6 commit 007b183
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- AVR DIN0-7 pins ISR was not enabled (#201)
- fixed error were coordinates would be forgotten/override if applying multiple G10 commands for different axis (ex. G10L20X0 and G10L20Y0) (#204)
- fixed logic error when both limits switches are active for an axis (not dual-drive) and are inverted, trigger would only happen if both were pressed (#205)
- fixed logic ORING of signals when homing leading to incorrect trigger when self-squaring cause by #205 (#207)

## [1.4.3] - 2022-05-02

Expand Down
17 changes: 9 additions & 8 deletions uCNC/src/core/io_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,22 @@ uint8_t io_get_limits(void)
uint8_t value2 = 0;

#if !(LIMIT_X2 < 0)
// #if !(LIMITS_DUAL_MASK & LIMIT_X_MASK)
#if !(LIMITS_DUAL_MASK & LIMIT_X_MASK)
value2 |= ((mcu_get_input(LIMIT_X2)) ? LIMIT_X_MASK : 0);
// #endif
#endif
#endif
#if !(LIMIT_Y2 < 0)
// #if !(LIMITS_DUAL_MASK & LIMIT_Y_MASK)
#if !(LIMITS_DUAL_MASK & LIMIT_Y_MASK)
value2 |= ((mcu_get_input(LIMIT_Y2)) ? LIMIT_Y_MASK : 0);
// #endif
#endif
#endif
#if !(LIMIT_Z2 < 0)
// #if !(LIMITS_DUAL_MASK & LIMIT_Z_MASK)
#if !(LIMITS_DUAL_MASK & LIMIT_Z_MASK)
value2 |= ((mcu_get_input(LIMIT_Z2)) ? LIMIT_Z_MASK : 0);
// #endif
#endif
#endif

result |= (value2 ^ (inv & LIMITS_DUAL_INV_MASK));
result |= (value2 ^ (inv & LIMITS_DUAL_INV_MASK & ~LIMITS_DUAL_MASK));

#endif

Expand Down Expand Up @@ -253,7 +253,8 @@ uint8_t io_get_limits_dual(void)
value |= ((mcu_get_input(LIMIT_Z2)) ? LIMIT_Z_MASK : 0);
#endif
#endif
return (value ^ (g_settings.limits_invert_mask & LIMITS_DUAL_MASK & LIMITS_DUAL_INV_MASK));
uint8_t inv = io_invert_limits_mask & LIMITS_DUAL_MASK;
return (value ^ (g_settings.limits_invert_mask & LIMITS_DUAL_MASK & LIMITS_DUAL_INV_MASK) ^ inv);
#endif
}

Expand Down

0 comments on commit 007b183

Please sign in to comment.