* Open a G-code file and set Marlin to start processing it. * Enqueues M23 and M24 commands to initiate a media print. */
| 693 | * Enqueues M23 and M24 commands to initiate a media print. |
| 694 | */ |
| 695 | void 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. |
no test coverage detected