X Y endstop issues

On my Azteeg X5 GT I am having odd behaviour with X and Y endstops:

M119 shows 0 for XYZ when all are in the open state.

Homing Z works fine and it shows as 1 in the closed state.

However, if either X or Y (but not both) are in the closed state it will show as 0.

The homing will crash on the Y axis unless I press the X at the same time. Having both X and Y in the closed state reports 1 for both but if I release one and hold the other, they both go back to 0.

The X and Y endstops have been tested and verified to work on the Z axis (moved with wiring also).

Any thoughts?

Thanks!

endstops_enable true # The endstop module is enabled by default and can be disabled here
corexy_homing true # Set to true if homing on a hbot or corexy
alpha_min_endstop 1.24! # Pin to read min endstop, add a ! to invert if endstop is NO connected to ground
#alpha_max_endstop nc # Pin to read max endstop, uncomment this and comment the above if using max endstops
alpha_homing_direction home_to_min # Or set to home_to_max and set alpha_max and uncomment the alpha_max_endstop
alpha_min 0 # This gets loaded as the current position after homing when home_to_min is set
alpha_max 280 # This gets loaded as the current position after homing when home_to_max is set
beta_min_endstop 1.25! # Pin to read min endstop, add a ! to invert if endstop is NO connected to ground
#beta_max_endstop nc # Pin to read max endstop, uncomment this and comment the above if using max endstops
beta_homing_direction home_to_min # Or set to home_to_max and set alpha_max and uncomment the alpha_max_endstop
beta_min 8 # This gets loaded as the current position after homing when home_to_min is set
beta_max 300 # This gets loaded as the current position after homing when home_to_max is set
gamma_min_endstop 1.26! # Pin to read min endstop, add a ! to invert if endstop is NO connected to ground
#gamma_max_endstop nc # Pin to read max endstop, uncomment this and comment the above if using max endstops
gamma_homing_direction home_to_min # Or set to home_to_max and set alpha_max and uncomment the alpha_max_endstop
gamma_min 0 # This gets loaded as the current position after homing when home_to_min is set
gamma_max 400 # This gets loaded as the current position after homing when home_to_max is set

Imported from wikidot

Solved the issue in case anyone else has the same problem.

Looks like the Xmin and Ymin are shorted on the board somewhere. I switched the Xmin pin to the Xmax pin and everything works now.