|
|
@ -268,6 +268,11 @@ bool wait_for_heatup = true; |
|
|
|
* ******************************** FUNCTIONS ******************************** |
|
|
|
* *************************************************************************** |
|
|
|
*/ |
|
|
|
#ifdef LED_SW_PIN |
|
|
|
void setup_LED_SW_pin() { |
|
|
|
SET_INPUT_PULLDOWN(LED_SW_PIN); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void setup_killpin() { |
|
|
|
#if HAS_KILL |
|
|
@ -559,6 +564,20 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef LED_SW_PIN |
|
|
|
static int LedSw_Count = 0; // make the inactivity button a bit less responsive
|
|
|
|
const int LED_SW_DELAY = 100; |
|
|
|
bool led_pin_status = !READ(LED_SW_PIN); |
|
|
|
if (led_pin_status && LedSw_Count <= LED_SW_DELAY) |
|
|
|
LedSw_Count++; |
|
|
|
else if (!led_pin_status) |
|
|
|
LedSw_Count = 0; |
|
|
|
if (LedSw_Count == LED_SW_DELAY){ |
|
|
|
caselight.on = !caselight.on; |
|
|
|
caselight.update(true); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_HOME |
|
|
|
// Handle a standalone HOME button
|
|
|
|
constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL; |
|
|
@ -1002,6 +1021,10 @@ void setup() { |
|
|
|
|
|
|
|
SETUP_RUN(setup_killpin()); |
|
|
|
|
|
|
|
#ifdef LED_SW_PIN |
|
|
|
SETUP_RUN(setup_LED_SW_pin()); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_TMC220x |
|
|
|
SETUP_RUN(tmc_serial_begin()); |
|
|
|
#endif |
|
|
|