|
@ -502,19 +502,16 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if HAS_HOME |
|
|
#if HAS_HOME |
|
|
// Check to see if we have to home, use poor man's debouncer
|
|
|
// Handle a standalone HOME button
|
|
|
// ---------------------------------------------------------
|
|
|
constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL; |
|
|
static int homeDebounceCount = 0; // poor man's debouncing count
|
|
|
static millis_t next_home_key_ms; // = 0
|
|
|
const int HOME_DEBOUNCE_DELAY = 2500; |
|
|
if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { // HOME_PIN goes LOW when pressed
|
|
|
if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { |
|
|
const millis_t ms = millis(); |
|
|
if (!homeDebounceCount) { |
|
|
if (ELAPSED(ms, next_home_key_ms)) { |
|
|
queue.inject_P(PSTR("G28")); |
|
|
next_home_key_ms = ms + HOME_DEBOUNCE_DELAY; |
|
|
LCD_MESSAGEPGM(MSG_AUTO_HOME); |
|
|
LCD_MESSAGEPGM(MSG_AUTO_HOME); |
|
|
|
|
|
queue.enqueue_now_P(PSTR("G28")); |
|
|
} |
|
|
} |
|
|
if (homeDebounceCount < HOME_DEBOUNCE_DELAY) |
|
|
|
|
|
homeDebounceCount++; |
|
|
|
|
|
else |
|
|
|
|
|
homeDebounceCount = 0; |
|
|
|
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|