Update system.c
Correct control pin state checking within pin change interrupt. Improper if-else statements could lead to missed signal.
This commit is contained in:
parent
0b5604bd7b
commit
addb1a9813
1 changed files with 5 additions and 3 deletions
|
|
@ -66,13 +66,15 @@ ISR(CONTROL_INT_vect)
|
||||||
if (pin) {
|
if (pin) {
|
||||||
if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET)) {
|
if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET)) {
|
||||||
mc_reset();
|
mc_reset();
|
||||||
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_CYCLE_START)) {
|
}
|
||||||
|
if (bit_istrue(pin,CONTROL_PIN_INDEX_CYCLE_START)) {
|
||||||
bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
|
bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
|
||||||
|
}
|
||||||
#ifndef ENABLE_SAFETY_DOOR_INPUT_PIN
|
#ifndef ENABLE_SAFETY_DOOR_INPUT_PIN
|
||||||
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_FEED_HOLD)) {
|
if (bit_istrue(pin,CONTROL_PIN_INDEX_FEED_HOLD)) {
|
||||||
bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
|
bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
|
||||||
#else
|
#else
|
||||||
} else if (bit_istrue(pin,CONTROL_PIN_INDEX_SAFETY_DOOR)) {
|
if (bit_istrue(pin,CONTROL_PIN_INDEX_SAFETY_DOOR)) {
|
||||||
bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
|
bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue