Browse Source

Watch idle() depth over 5

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
2ecb4fad72
  1. 12
      Marlin/src/MarlinCore.cpp

12
Marlin/src/MarlinCore.cpp

@ -709,6 +709,10 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
* - Handle Joystick jogging * - Handle Joystick jogging
*/ */
void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
#if ENABLED(MARLIN_DEV_MODE)
static uint8_t idle_depth = 0;
if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", int(idle_depth));
#endif
// Core Marlin activities // Core Marlin activities
manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep)); manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
@ -720,7 +724,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
TERN_(MAX7219_DEBUG, max7219.idle_tasks()); TERN_(MAX7219_DEBUG, max7219.idle_tasks());
// Return if setup() isn't completed // Return if setup() isn't completed
if (marlin_state == MF_INITIALIZING) return; if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
// Handle filament runout sensors // Handle filament runout sensors
TERN_(HAS_FILAMENT_SENSOR, runout.run()); TERN_(HAS_FILAMENT_SENSOR, runout.run());
@ -764,6 +768,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
// Run i2c Position Encoders // Run i2c Position Encoders
#if ENABLED(I2C_POSITION_ENCODERS) #if ENABLED(I2C_POSITION_ENCODERS)
{
static millis_t i2cpem_next_update_ms; static millis_t i2cpem_next_update_ms;
if (planner.has_blocks_queued()) { if (planner.has_blocks_queued()) {
const millis_t ms = millis(); const millis_t ms = millis();
@ -772,6 +777,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS; i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS;
} }
} }
}
#endif #endif
// Auto-report Temperatures / SD Status // Auto-report Temperatures / SD Status
@ -793,6 +799,10 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
// Update the LVGL interface // Update the LVGL interface
TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER()); TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER());
IDLE_DONE:
TERN_(MARLIN_DEV_MODE, idle_depth--);
return;
} }
/** /**

Loading…
Cancel
Save