Przeglądaj źródła

Watch idle() depth over 5

Scott Lahteine 4 lat temu
rodzic
commit
2ecb4fad72
1 zmienionych plików z 11 dodań i 1 usunięć
  1. 11
    1
      Marlin/src/MarlinCore.cpp

+ 11
- 1
Marlin/src/MarlinCore.cpp Wyświetl plik

@@ -709,6 +709,10 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
709 709
  *  - Handle Joystick jogging
710 710
  */
711 711
 void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
712
+  #if ENABLED(MARLIN_DEV_MODE)
713
+    static uint8_t idle_depth = 0;
714
+    if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", int(idle_depth));
715
+  #endif
712 716
 
713 717
   // Core Marlin activities
714 718
   manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
@@ -720,7 +724,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
720 724
   TERN_(MAX7219_DEBUG, max7219.idle_tasks());
721 725
 
722 726
   // Return if setup() isn't completed
723
-  if (marlin_state == MF_INITIALIZING) return;
727
+  if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
724 728
 
725 729
   // Handle filament runout sensors
726 730
   TERN_(HAS_FILAMENT_SENSOR, runout.run());
@@ -764,6 +768,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
764 768
 
765 769
   // Run i2c Position Encoders
766 770
   #if ENABLED(I2C_POSITION_ENCODERS)
771
+  {
767 772
     static millis_t i2cpem_next_update_ms;
768 773
     if (planner.has_blocks_queued()) {
769 774
       const millis_t ms = millis();
@@ -772,6 +777,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
772 777
         i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS;
773 778
       }
774 779
     }
780
+  }
775 781
   #endif
776 782
 
777 783
   // Auto-report Temperatures / SD Status
@@ -793,6 +799,10 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
793 799
 
794 800
   // Update the LVGL interface
795 801
   TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER());
802
+
803
+  IDLE_DONE:
804
+  TERN_(MARLIN_DEV_MODE, idle_depth--);
805
+  return;
796 806
 }
797 807
 
798 808
 /**

Ładowanie…
Anuluj
Zapisz