Skip to content

Commit

Permalink
Disable CR-adding when transferring files via XModem (#528)
Browse files Browse the repository at this point in the history
* Disable CR-adding when transferring files via XModem

The UART channel have the feature for adding extra CR on line feeds enabled which will break the XModem protocol. This fix will disable the extra CR adding and restore the setting after the file is sent.

* Changed variable name to be consistent with other code.
  • Loading branch information
breiler authored Jul 16, 2022
1 parent 2adb1b8 commit 5db1039
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FluidNC/src/ProcessSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,10 @@ static Error xmodem_send(const char* value, WebUI::AuthenticationLevel auth_leve
log_info("Cannot open " << value);
return Error::DownloadFailed;
}
bool oldCr = out.setCr(false);
log_info("Sending " << value << " via XModem");
int size = xmodemTransmit(&out, infile);
out.setCr(oldCr);
delete infile;
if (size >= 0) {
log_info("Sent " << size << " bytes");
Expand Down

0 comments on commit 5db1039

Please sign in to comment.