# How to programmatically resume a paused print in Marlin

A print that is paused with an M0 can be unpaused with M108. That works with my Chiron running Marlin 2.0.7.2. However, it also has a display that uses its' own serial protocol to communicate with Marlin. I want that display to be able to unpause my printer when it has encountered M0 in the G-code. I tried injectCommands_P(PSTR("M108\n")); in the code, but it did not work. Perhaps I should not have a new-line at the end of it.

What is the correct command to do this?

void GcodeSuite::M108() {
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);
wait_for_heatup = false;
}


Above is the Marlin code for M108. Would be great if someone could decipher what TERN means.

• TERN is short for "Ternary Macro". Scroll down on this web page to find what it is used for. Basically, this is an if-then statement.
– 0scar
Feb 14 at 23:05
• under pause, the next line of G-code isn't read Feb 15 at 10:25
The correct Marlin-command to unpause seems to be setUserConfirmed(). I have tested that it works.