Marlin firmware function call location for menu commands?
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")