Skip to content

Commit addb1a9

Browse files
authored
Update system.c
Correct control pin state checking within pin change interrupt. Improper if-else statements could lead to missed signal.
1 parent 0b5604b commit addb1a9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

grbl/system.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ ISR(CONTROL_INT_vect)
6666
if (pin) {
6767
if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET)) {
6868
mc_reset();
69-
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_CYCLE_START)) {
69+
}
70+
if (bit_istrue(pin,CONTROL_PIN_INDEX_CYCLE_START)) {
7071
bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
72+
}
7173
#ifndef ENABLE_SAFETY_DOOR_INPUT_PIN
72-
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_FEED_HOLD)) {
74+
if (bit_istrue(pin,CONTROL_PIN_INDEX_FEED_HOLD)) {
7375
bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
7476
#else
75-
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_SAFETY_DOOR)) {
77+
if (bit_istrue(pin,CONTROL_PIN_INDEX_SAFETY_DOOR)) {
7678
bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
7779
#endif
7880
}

0 commit comments

Comments
 (0)