MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / openAndPrintFile

Method openAndPrintFile

Marlin/src/sd/cardreader.cpp:695–701  ·  view source on GitHub ↗

* Open a G-code file and set Marlin to start processing it. * Enqueues M23 and M24 commands to initiate a media print. */

Source from the content-addressed store, hash-verified

693 * Enqueues M23 and M24 commands to initiate a media print.
694 */
695void CardReader::openAndPrintFile(const char *name) {
696 char cmd[4 + strlen(name) + 1 + 3 + 1]; // Room for "M23 ", filename, "\n", "M24", and null
697 sprintf_P(cmd, M23_STR, name);
698 for (char *c = &cmd[4]; *c; c++) *c = tolower(*c);
699 strcat_P(cmd, PSTR("\nM24"));
700 queue.inject(cmd);
701}
702
703/**
704 * Start or resume a media print by setting the sdprinting flag.

Callers 9

printFileFunction · 0.80
process_lcd_p_commandFunction · 0.80
one_click_printFunction · 0.80
hmiSelectFileFunction · 0.80
onClickConfirmToPrintFunction · 0.80
gotoConfirmToPrintFunction · 0.80
fileControlMethod · 0.80
printButtonMethod · 0.80

Calls 1

injectMethod · 0.80

Tested by

no test coverage detected