612,13 → 612,23 |
if(HugeBlockFromFC.WhoAmI == 1) // contains eeprom-Data |
{ |
u8 crc1, crc2; |
// static u8 first_time = 1; |
crc1 = HugeBlockFromFC.Data[sizeof(EE_Parameter)-1]; // contains the EE_Parameter.crc |
crc2 = RAM_Checksum((u8 *)(&HugeBlockFromFC.Data), sizeof(EE_Parameter)-1); // calculates the current crc |
if(crc1 == crc2) |
{ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + get EE_Parameters from FC |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
memcpy(&EE_Parameter, (u8 *) HugeBlockFromFC.Data, sizeof(EE_Parameter)); |
RequestConfigFromFC = 0; |
if(UART_VersionInfo.HWMajor >= 30) SendOemName = 1; |
// if(first_time) |
{ |
WP_MissionParameter.ComingHomeAltitude = EE_Parameter.ComingHomeAltitude; |
WP_MissionParameter.FailsafeAltitude = EE_Parameter.FailSafeAltitude; |
WP_MissionParameter.TriggerMask = EE_Parameter.J16Bitmask; |
} |
} |
HugeBlockFromFC.WhoAmI = 0; |
} |