Update MarlinCore.cpp

This commit is contained in:
InsanityAutomation
2024-04-07 19:33:27 -04:00
parent a3434de2e6
commit 55360141fd
+10 -4
View File
@@ -474,11 +474,17 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#if HAS_KILL
// Check if the kill button was pressed and wait just in case it was an accidental
// key kill key press
// Check if the kill button was pressed and wait to ensure the signal is not noise
// typically caused by poor insulation and grounding on LCD cables.
// Lower numbers here will increase response time and therefore safety rating.
// It is recommended to set this as low as possibe without false triggers.
// -------------------------------------------------------------------------------
#ifndef KILL_DELAY
#define KILL_DELAY 250
#endif
static int killCount = 0; // make the inactivity button a bit less responsive
const int KILL_DELAY = 750;
const int killDelay = KILL_DELAY;
if (kill_state())
killCount++;
else if (killCount > 0)
@@ -487,7 +493,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
// Exceeded threshold and we can confirm that it was not accidental
// KILL the machine
// ----------------------------------------------------------------
if (killCount >= KILL_DELAY) {
if (killCount >= killDelay) {
SERIAL_ERROR_START();
SERIAL_ECHOPGM(STR_KILL_PRE);
SERIAL_ECHOLNPGM(STR_KILL_BUTTON);