def _CalculateCRC(self, flashData): # Flatten the flash data allData = [] for row in flashData: for byte in row: allData.append(byte) # Get the offset and size for the CRC register [offset, size] = self.flash.GetOffsetForRegister('CONFIG_CRC') # Make sure we don't include the CRC data allData = allData[offset+size:] # Calculate the CRC crc = CalculateCRC.calculate(allData) return crc
def _CalculateCRC(self, flashData): # Flatten the flash data allData = [] for row in flashData: for byte in row: allData.append(byte) # Get the offset and size for the CRC register [offset, size] = self.flash.GetOffsetForRegister('CONFIG_CRC') # Make sure we don't include the CRC data allData = allData[offset + size:] # Calculate the CRC crc = CalculateCRC.calculate(allData) return crc