diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index b551b9d..5b008b3 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -548,7 +548,7 @@ uint32_t updateCRC(const byte *buffer, size_t length, uint32_t crc) { uint32_t calculateCRC(const byte *buffer, size_t length) { uint32_t crc = 0xFFFFFFFF; - updateCRC(buffer, length, crc); + crc = updateCRC(buffer, length, crc); return ~crc; } @@ -557,7 +557,7 @@ uint32_t calculateCRC(FsFile &infile) { uint32_t crc = 0xFFFFFFFF; while((byte_count = infile.read(sdBuffer, sizeof(sdBuffer))) != 0) { - updateCRC(sdBuffer, byte_count, crc); + crc = updateCRC(sdBuffer, byte_count, crc); } return ~crc; }