Обновление
This commit is contained in:
parent
addcb93d2a
commit
1a5839cbde
|
|
@ -9,7 +9,7 @@
|
||||||
#include "HVAC_preDefine.h"
|
#include "HVAC_preDefine.h"
|
||||||
|
|
||||||
#define DEVICE_DATA_VERSION_CALIB 0x01
|
#define DEVICE_DATA_VERSION_CALIB 0x01
|
||||||
#define DEVICE_DATA_VERSION_PARAM 0x01
|
#define DEVICE_DATA_VERSION_PARAM 0x02
|
||||||
|
|
||||||
// BCD в двоичное число
|
// BCD в двоичное число
|
||||||
#define bcd_to_binary(bcd) (((bcd >> 4) * 10) + (bcd & 0x0F))
|
#define bcd_to_binary(bcd) (((bcd >> 4) * 10) + (bcd & 0x0F))
|
||||||
|
|
@ -53,6 +53,13 @@ typedef struct {
|
||||||
char ECU_boot_software_identification_ECU_supplier[2];
|
char ECU_boot_software_identification_ECU_supplier[2];
|
||||||
} ecu_identification_t;
|
} ecu_identification_t;
|
||||||
|
|
||||||
|
typedef struct __attribute__ ((packed)) {
|
||||||
|
uint32_t meta_fw_crc;
|
||||||
|
uint32_t size_fw;
|
||||||
|
tInternal_SW_Version internal_SW_Version;
|
||||||
|
tFingerprint fingerprint;
|
||||||
|
} tFirmwareMetaMap;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ecu_identification_t identification;
|
ecu_identification_t identification;
|
||||||
} tDeviceSettings;
|
} tDeviceSettings;
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,33 @@
|
||||||
//
|
//
|
||||||
#include "DataNonVolatatile_Private.h"
|
#include "DataNonVolatatile_Private.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "FirmwareMetadataSection.h"
|
||||||
|
|
||||||
void DeviceStorageInitDeviceSettings(tDeviceSettings *env) {
|
void DeviceStorageInitDeviceSettings(tDeviceSettings *env) {
|
||||||
|
|
||||||
|
tFirmwareMetaMap *firmwareMetaMap_Boot = (tFirmwareMetaMap *) ADR_META_BOOT;
|
||||||
|
tFirmwareMetaMap *firmwareMetaMap_Main = (tFirmwareMetaMap *) ADR_META_MAIN;
|
||||||
|
|
||||||
|
|
||||||
|
memcpy(&env->identification.Internal_SW_Version, &firmwareMetaMap_Main->internal_SW_Version,
|
||||||
|
sizeof(tInternal_SW_Version));
|
||||||
|
memcpy(&env->identification.Boot_SW_Fingerprint, &firmwareMetaMap_Boot->fingerprint, sizeof(tFingerprint));
|
||||||
|
memcpy(&env->identification.Application_SW_Fingerprint, &firmwareMetaMap_Main->fingerprint, sizeof(tFingerprint));
|
||||||
|
|
||||||
|
env->identification.Tester_Fingerprint.year = 0x18;
|
||||||
|
env->identification.Tester_Fingerprint.month = 0x10;
|
||||||
|
env->identification.Tester_Fingerprint.day = 0x16;
|
||||||
|
memcpy(&env->identification.Tester_Fingerprint.tester_serial, "123456789",
|
||||||
|
sizeof(env->identification.Tester_Fingerprint.tester_serial));
|
||||||
|
|
||||||
|
/*
|
||||||
|
env->identification.Software_classification_identification[15];
|
||||||
|
env->identification.Spare_Part_Number[27];
|
||||||
|
env->identification.Serial_Number[26];
|
||||||
|
env->identification.Vehicle_Identification[17];
|
||||||
|
env->identification.ECU_hardware_number_NAMI[13];
|
||||||
|
env->identification.ECU_hardware_number_ECU_supplier[2];
|
||||||
|
env->identification.ECU_software_number_ECU_supplier[2];
|
||||||
|
env->identification.ECU_boot_software_identification_ECU_supplier[2];
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue