Marlin firmware function call location for menu commands? I found the pause_print() function in Marlin_main.cpp but when I search the rest of the files I cannot find the file that calls this function. I expected to find it somewhere in the file that controls the LCD menu but it only exists in main.

What file has the function calls that happen when I select a menu option from the LCD?

And why isn't pause_print() showing up elsewhere as a function call?
This function is called by the g-codes M125 and M600

I could find ADVANCED_PAUSE_FEATURE defined in configuration_adv.h and called in Conditionals_post.h, trice in Marlin.h, referenced as needed for M600 in Marlin_Main.ccp and mentioned 2 times.

In Marlin_Main.ccp it also declares the function pause_print in line 6482 to 6571. Its start and end are these:

static bool pause_print(const float &amp;retract, const point_t &amp;park_point, const float &amp;unload_length = 0,
                          const int8_t max_beep_count = 0, const bool show_lcd = false
  ) {
    if (move_away_flag) return false; // already paused

    #ifdef ACTION_ON_PAUSE
      SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
    #endif

[...]

    HOTEND_LOOP()
    thermalManager.start_heater_idle_timer(e, nozzle_timeout);

    return true;
  }


This function does define the pause state, and relies on the ADVANCED_PAUSE_FEATURE in some cases. But what calls it? Simple enough, both calls are in the same Marlin_Main.ccp that defines it. The calls are in the functions that are used for filament change:


gcode_M125line 8534 (Save current position and move to filament change position)
gcode_M600line 9939 (Pause for filament change: "M600 X Y Z E L")