End stop switch

This code doesn't show any Y motor. Only X_DIR and X_STP. The Y motor should not be moving at all unless it is wired to the X pins. If it IS wired to the X pins there is no way to stop the X motor without also stopping the 'Y' motor connected to the same pins.