From 5b97a79b6d74fa99fe32246f20ce5f275e1279c4 Mon Sep 17 00:00:00 2001 From: ashelly Date: Wed, 17 Sep 2014 23:41:52 -0400 Subject: [PATCH] No false alarm if other bits in port are set. --- motion_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motion_control.c b/motion_control.c index 3b0b171..2208a93 100644 --- a/motion_control.c +++ b/motion_control.c @@ -242,7 +242,7 @@ void mc_homing_cycle() { uint8_t limits_on; if (bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS)) { - limits_on = (LIMIT_PIN ^ LIMIT_MASK); + limits_on = ((~LIMIT_PIN) & LIMIT_MASK); } else { limits_on = (LIMIT_PIN & LIMIT_MASK); }