File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,18 @@ void system_init()
40
40
uint8_t system_control_get_state ()
41
41
{
42
42
uint8_t control_state = 0 ;
43
- uint8_t pin = (CONTROL_PIN & CONTROL_MASK );
43
+ uint8_t pin = (CONTROL_PIN & CONTROL_MASK ) ^ CONTROL_MASK ;
44
44
#ifdef INVERT_CONTROL_PIN_MASK
45
45
pin ^= INVERT_CONTROL_PIN_MASK ;
46
46
#endif
47
47
if (pin ) {
48
48
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
49
- if (bit_isfalse (pin ,(1 <<CONTROL_SAFETY_DOOR_BIT ))) { control_state |= CONTROL_PIN_INDEX_SAFETY_DOOR ; }
49
+ if (bit_istrue (pin ,(1 <<CONTROL_SAFETY_DOOR_BIT ))) { control_state |= CONTROL_PIN_INDEX_SAFETY_DOOR ; }
50
+ #else
51
+ if (bit_istrue (pin ,(1 <<CONTROL_FEED_HOLD_BIT ))) { control_state |= CONTROL_PIN_INDEX_FEED_HOLD ; }
50
52
#endif
51
- if (bit_isfalse (pin ,(1 <<CONTROL_RESET_BIT ))) { control_state |= CONTROL_PIN_INDEX_RESET ; }
52
- if (bit_isfalse (pin ,(1 <<CONTROL_FEED_HOLD_BIT ))) { control_state |= CONTROL_PIN_INDEX_FEED_HOLD ; }
53
- if (bit_isfalse (pin ,(1 <<CONTROL_CYCLE_START_BIT ))) { control_state |= CONTROL_PIN_INDEX_CYCLE_START ; }
53
+ if (bit_istrue (pin ,(1 <<CONTROL_RESET_BIT ))) { control_state |= CONTROL_PIN_INDEX_RESET ; }
54
+ if (bit_istrue (pin ,(1 <<CONTROL_CYCLE_START_BIT ))) { control_state |= CONTROL_PIN_INDEX_CYCLE_START ; }
54
55
}
55
56
return (control_state );
56
57
}
You can’t perform that action at this time.
0 commit comments