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

Method write_command

Marlin/src/sd/cardreader.cpp:959–975  ·  view source on GitHub ↗

Write a command to the log file

Source from the content-addressed store, hash-verified

957// Write a command to the log file
958//
959void CardReader::write_command(char * const buf) {
960 char *begin = buf,
961 *npos = nullptr,
962 *end = buf + strlen(buf) - 1;
963
964 myfile.writeError = false;
965 if ((npos = strchr(buf, 'N'))) {
966 begin = strchr(npos, ' ') + 1;
967 end = strchr(npos, '*') - 1;
968 }
969 end[1] = '\r';
970 end[2] = '\n';
971 end[3] = '\0';
972 myfile.write(begin);
973
974 if (myfile.writeError) SERIAL_ERROR_MSG(STR_SD_ERR_WRITE_TO_FILE);
975}
976
977#if DISABLED(NO_SD_AUTOSTART)
978 /**

Callers 1

advanceMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected