Skip to content

Commit

Permalink
🎨 Call millis() once in manage_inactivity (#22363)
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbro authored and thinkyhead committed Jul 17, 2021
1 parent 7ae099f commit 8cf15e8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL;
static millis_t next_home_key_ms; // = 0
if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { // HOME_PIN goes LOW when pressed
const millis_t ms = millis();
if (ELAPSED(ms, next_home_key_ms)) {
next_home_key_ms = ms + HOME_DEBOUNCE_DELAY;
LCD_MESSAGEPGM(MSG_AUTO_HOME);
Expand All @@ -522,7 +521,6 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#if ENABLED(CUSTOM_USER_BUTTONS)
// Handle a custom user button if defined
const bool printer_not_busy = !printingIsActive();
const millis_t ms = millis();
#define HAS_CUSTOM_USER_BUTTON(N) (PIN_EXISTS(BUTTON##N) && defined(BUTTON##N##_HIT_STATE) && defined(BUTTON##N##_GCODE))
#define HAS_BETTER_USER_BUTTON(N) HAS_CUSTOM_USER_BUTTON(N) && defined(BUTTON##N##_DESC)
#define _CHECK_CUSTOM_USER_BUTTON(N, CODE) do{ \
Expand Down

0 comments on commit 8cf15e8

Please sign in to comment.