mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
BL_HELPER: call CRC_Ini() from within CRC check function
This commit is contained in:
parent
0a05896146
commit
150464344d
@ -1230,7 +1230,6 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
{
|
||||
FirmwareIAPObjData firmwareIAPObj;
|
||||
FirmwareIAPObjGet(&firmwareIAPObj);
|
||||
CRC_Ini();
|
||||
if(firmwareIAPObj.ArmReset==0)
|
||||
reset_count=0;
|
||||
if(firmwareIAPObj.ArmReset==1)
|
||||
@ -1251,7 +1250,6 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=FLASH_crc_memory_calc())
|
||||
{
|
||||
FLASH_read_description(firmwareIAPObj.Description,SIZE_OF_DESCRIPTION);
|
||||
CRC_Ini();
|
||||
firmwareIAPObj.crc=FLASH_crc_memory_calc();
|
||||
firmwareIAPObj.BoardRevision=BOARD_REVISION;
|
||||
FirmwareIAPObjSet(&firmwareIAPObj);
|
||||
|
@ -127,13 +127,11 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
|
||||
this_time = get_time();
|
||||
delta = this_time - last_time;
|
||||
last_time = this_time;
|
||||
CRC_Ini();
|
||||
if((data.BoardType==BOARD_TYPE)&&(data.crc != FLASH_crc_memory_calc()))
|
||||
{
|
||||
FLASH_read_description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
|
||||
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
|
||||
data.BoardRevision=BOARD_REVISION;
|
||||
CRC_Ini();
|
||||
data.crc = FLASH_crc_memory_calc();
|
||||
FirmwareIAPObjSet( &data );
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ uint8_t FLASH_Start()
|
||||
|
||||
uint32_t FLASH_crc_memory_calc()
|
||||
{
|
||||
CRC_Ini();
|
||||
CRC_ResetDR();
|
||||
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
||||
return CRC_GetCRC();
|
||||
|
Loading…
Reference in New Issue
Block a user