From a6b783a5293bd1259d88a070d8510d29ad123be4 Mon Sep 17 00:00:00 2001 From: juanfc Date: Mon, 2 Dec 2013 13:27:04 -0200 Subject: [PATCH] Update RS485.cpp Added for problems with crc = STX or ETX in Function crc8 before return if(crc==STX || crc==ETX) crc=crc-2; return crc; --- RS485.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RS485.cpp b/RS485.cpp index ac326dc..aefe3cd 100644 --- a/RS485.cpp +++ b/RS485.cpp @@ -42,6 +42,10 @@ byte crc8 (const char *addr) inbyte >>= 1; } // end of for } // end of while + + //ADDED FOR PROBLEMS WITH crc = STX or ETX + if(crc==STX || crc==ETX) crc=crc-2; + return crc; } // end of crc8