Skip to content

Commit 4d0097f

Browse files
committed
forces tool stop on door open
1 parent 0138972 commit 4d0097f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

uCNC/src/cnc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,8 @@ bool cnc_check_interlocking(void)
11001100
cnc_alarm(EXEC_ALARM_HOMING_FAIL_DOOR);
11011101
return false;
11021102
}
1103+
1104+
itp_stop_tools();
11031105
}
11041106
#endif
11051107

uCNC/src/hal/tools/tool.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ void tool_set_speed(int16_t value)
232232
tool_current_speed = value;
233233
if (tool_current.set_speed)
234234
{
235+
#if ASSERT_PIN(SAFETY_DOOR)
236+
// the safety door condition is active
237+
if (cnc_get_exec_state(EXEC_DOOR))
238+
{
239+
value = 0;
240+
}
241+
#endif
235242
tool_current.set_speed(value);
236243
}
237244
#endif
@@ -276,6 +283,13 @@ void tool_set_coolant(uint8_t value)
276283
#if TOOL_COUNT > 0
277284
if (tool_current.set_coolant)
278285
{
286+
#if ASSERT_PIN(SAFETY_DOOR)
287+
// the safety door condition is active
288+
if (cnc_get_exec_state(EXEC_DOOR))
289+
{
290+
value = 0;
291+
}
292+
#endif
279293
tool_current.set_coolant(value);
280294
}
281295
#endif

0 commit comments

Comments
 (0)