2
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ That is because this function has nothing to do with pausing the printer from the display menu. This function is used by the functionality that pauses the printer as part of filament changing or parking head on pause. Used by M125 and M600. $\endgroup$ – 0scar Dec 15 '18 at 23:26
  • $\begingroup$ Ahhh. Thank you; my mistake. I foolishly thought that the function that pauses the printer would be called "pause". Would you happen to know where that function call is located? thanks $\endgroup$ – cds333 Dec 17 '18 at 11:01
  • $\begingroup$ Why did you delete your other question (adding menu items)? It was a valid one, I already started an answer for that one! $\endgroup$ – 0scar Dec 17 '18 at 11:06
2
$\begingroup$

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 &retract, const point_t &park_point, const float &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")
$\endgroup$
2
  • $\begingroup$ Thank you! The reason I ask is that my Ender 3 used to park the nozzle assembly when I pause, which allowed me to inspect my print. Now after I flash with generic marlin it does not, it just stops printing but the nozzle doesn't move ......................................................................................................................................................... I figured I would just edit one of the parameters passed from the function call but if I cant find where it is called when accessed from the menu then I cannot do that. So how would I fix that? Thanks $\endgroup$ – cds333 Dec 17 '18 at 10:53
  • $\begingroup$ @cds333 tha is a different question. Open a new question for that. $\endgroup$ – Trish Dec 17 '18 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.