1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Flashfs: Missed calculation of the header crc for monolitihic write

This commit is contained in:
James Cotton 2012-01-26 13:32:53 -06:00
parent 84dd1dbc40
commit 85bfa7dcf9

View File

@ -249,6 +249,7 @@ int32_t PIOS_FLASHFS_ObjSave(UAVObjHandle obj, uint16_t instId, uint8_t * data)
}; };
// Update CRC // Update CRC
crc = PIOS_CRC_updateCRC(0, (uint8_t *) &header, sizeof(header));
crc = PIOS_CRC_updateCRC(crc, (uint8_t *) data, UAVObjGetNumBytes(obj)); crc = PIOS_CRC_updateCRC(crc, (uint8_t *) data, UAVObjGetNumBytes(obj));
if(PIOS_Flash_Jedec_EraseSector(addr) != 0) if(PIOS_Flash_Jedec_EraseSector(addr) != 0)