From f84f7e5a382b37c75e37f9d76f86fff94e936f37 Mon Sep 17 00:00:00 2001 From: Adrian Cuzman Date: Wed, 28 Mar 2018 20:43:41 +0200 Subject: [PATCH] Require a checksum when writing to SD (#10204) When streaming commands to SD with XON/XOFF, errors can occur and cause incomplete commands to be written to the file. This change ensures that only commands with line numbers and checksum will be saved to SD. --- Marlin/Marlin_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1f6a826d29..5e9945c7a1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1070,6 +1070,10 @@ inline void get_serial_commands() { gcode_LastN = gcode_N; } + else if (card.saving) { + gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); + return; + } // Movement commands alert when stopped if (IsStopped()) {