Обновление

This commit is contained in:
cfif 2026-02-24 14:54:37 +03:00
parent e7cca765e9
commit 2af548714f
2 changed files with 20 additions and 0 deletions

View File

@ -132,3 +132,20 @@ bool DeviceStorage_Init(tDeviceStorage *env, bool loadParamOnly, tStorageInterfa
return false;
}
void LoadFromStorageToStatusData(tDeviceStorage *env, ecu_identification_t *ecu) {
if (osMutexAcquire(env->dumpObserver.accessDumper, 1000) == osOK) {
memcpy(ecu, &env->dataParam->device.identification, sizeof(ecu_identification_t));
osMutexRelease(env->dumpObserver.accessDumper);
}
}
void SaveToStorageFromStatusData(tDeviceStorage *env, ecu_identification_t *ecu) {
if (osMutexAcquire(env->dumpObserver.accessDumper, 1000) == osOK) {
memcpy(&env->dataParam->device.identification, ecu, sizeof(ecu_identification_t));
osMutexRelease(env->dumpObserver.accessDumper);
}
DeviceStorageParam_DelayedDump(env);
}

View File

@ -32,4 +32,7 @@ void DeviceStorageCalib_ForceDump(tDeviceStorage *env);
void DeviceStorageParam_ForceDump(tDeviceStorage *env);
void DeviceStorageParam_DelayedDump(tDeviceStorage *env);
void LoadFromStorageToStatusData(tDeviceStorage *env, ecu_identification_t *ecu);
void SaveToStorageFromStatusData(tDeviceStorage *env, ecu_identification_t *ecu);
#endif //HVAC_DEVICESTORAGE_H