Patch some serial macros
This commit is contained in:
@ -109,7 +109,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
SdFile dir;
|
||||
if (!dir.open(parent, lfilename, O_READ)) {
|
||||
if (lsAction == LS_SerialPrint) {
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
|
||||
SERIAL_ECHOLN(lfilename);
|
||||
}
|
||||
@ -208,8 +208,8 @@ void CardReader::ls() {
|
||||
// Open the sub-item as the new dive parent
|
||||
SdFile dir;
|
||||
if (!dir.open(diveDir, segment, O_READ)) {
|
||||
SERIAL_EOL;
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
|
||||
SERIAL_ECHO(segment);
|
||||
break;
|
||||
@ -220,7 +220,7 @@ void CardReader::ls() {
|
||||
|
||||
} // while i<pathLen
|
||||
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
#endif // LONG_FILENAME_HOST_SUPPORT
|
||||
@ -239,20 +239,20 @@ void CardReader::initsd() {
|
||||
#endif
|
||||
) {
|
||||
//if (!card.init(SPI_HALF_SPEED,SDSS))
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
|
||||
}
|
||||
else if (!volume.init(&card)) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
|
||||
}
|
||||
else if (!root.openRoot(&volume)) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
|
||||
}
|
||||
else {
|
||||
cardOK = true;
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
|
||||
}
|
||||
workDir = root;
|
||||
@ -331,7 +331,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
if (isFileOpen()) { //replacing current file by new file, or subfile call
|
||||
if (push_current) {
|
||||
if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
|
||||
SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
|
||||
kill(PSTR(MSG_KILLED));
|
||||
@ -341,7 +341,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
// Store current filename and position
|
||||
getAbsFilename(proc_filenames[file_subcall_ctr]);
|
||||
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", name);
|
||||
SERIAL_ECHOPAIR("\" parent:\"", proc_filenames[file_subcall_ctr]);
|
||||
SERIAL_ECHOLNPAIR("\" pos", sdpos);
|
||||
@ -358,7 +358,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
}
|
||||
|
||||
if (doing) {
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM("Now ");
|
||||
SERIAL_ECHO(doing == 1 ? "doing" : "fresh");
|
||||
SERIAL_ECHOLNPAIR(" file: ", name);
|
||||
@ -421,14 +421,14 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
else {
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
else { //write
|
||||
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
else {
|
||||
saving = true;
|
||||
@ -462,7 +462,7 @@ void CardReader::removeFile(char* name) {
|
||||
if (!myDir.open(curDir, subdirname, O_READ)) {
|
||||
SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@ -526,7 +526,7 @@ void CardReader::write_command(char *buf) {
|
||||
end[3] = '\0';
|
||||
file.write(begin);
|
||||
if (file.writeError) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
|
||||
}
|
||||
}
|
||||
@ -617,7 +617,7 @@ void CardReader::chdir(const char * relpath) {
|
||||
if (workDir.isOpen()) parent = &workDir;
|
||||
|
||||
if (!newfile.open(*parent, relpath, O_READ)) {
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
|
||||
SERIAL_ECHOLN(relpath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user