File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,18 @@ void system_init()
4040uint8_t system_control_get_state ()
4141{
4242 uint8_t control_state = 0 ;
43- uint8_t pin = (CONTROL_PIN & CONTROL_MASK );
43+ uint8_t pin = (CONTROL_PIN & CONTROL_MASK ) ^ CONTROL_MASK ;
4444 #ifdef INVERT_CONTROL_PIN_MASK
4545 pin ^= INVERT_CONTROL_PIN_MASK ;
4646 #endif
4747 if (pin ) {
4848 #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 ; }
5052 #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 ; }
5455 }
5556 return (control_state );
5657}
You can’t perform that action at this time.
0 commit comments