kopia lustrzana https://github.com/gnea/grbl
Update system.c
rodzic
b75e5571ee
commit
cc4c0ffebc
|
@ -40,17 +40,18 @@ void system_init()
|
||||||
uint8_t system_control_get_state()
|
uint8_t system_control_get_state()
|
||||||
{
|
{
|
||||||
uint8_t control_state = 0;
|
uint8_t control_state = 0;
|
||||||
uint8_t pin = (CONTROL_PIN & CONTROL_MASK);
|
uint8_t pin = (CONTROL_PIN & CONTROL_MASK) ^ CONTROL_MASK;
|
||||||
#ifdef INVERT_CONTROL_PIN_MASK
|
#ifdef INVERT_CONTROL_PIN_MASK
|
||||||
pin ^= INVERT_CONTROL_PIN_MASK;
|
pin ^= INVERT_CONTROL_PIN_MASK;
|
||||||
#endif
|
#endif
|
||||||
if (pin) {
|
if (pin) {
|
||||||
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
|
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
|
||||||
if (bit_isfalse(pin,(1<<CONTROL_SAFETY_DOOR_BIT))) { control_state |= CONTROL_PIN_INDEX_SAFETY_DOOR; }
|
if (bit_istrue(pin,(1<<CONTROL_SAFETY_DOOR_BIT))) { control_state |= CONTROL_PIN_INDEX_SAFETY_DOOR; }
|
||||||
|
#else
|
||||||
|
if (bit_istrue(pin,(1<<CONTROL_FEED_HOLD_BIT))) { control_state |= CONTROL_PIN_INDEX_FEED_HOLD; }
|
||||||
#endif
|
#endif
|
||||||
if (bit_isfalse(pin,(1<<CONTROL_RESET_BIT))) { control_state |= CONTROL_PIN_INDEX_RESET; }
|
if (bit_istrue(pin,(1<<CONTROL_RESET_BIT))) { control_state |= CONTROL_PIN_INDEX_RESET; }
|
||||||
if (bit_isfalse(pin,(1<<CONTROL_FEED_HOLD_BIT))) { control_state |= CONTROL_PIN_INDEX_FEED_HOLD; }
|
if (bit_istrue(pin,(1<<CONTROL_CYCLE_START_BIT))) { control_state |= CONTROL_PIN_INDEX_CYCLE_START; }
|
||||||
if (bit_isfalse(pin,(1<<CONTROL_CYCLE_START_BIT))) { control_state |= CONTROL_PIN_INDEX_CYCLE_START; }
|
|
||||||
}
|
}
|
||||||
return(control_state);
|
return(control_state);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue