From 2af548714f6b30ae155d5b57146166d1a461625f Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 24 Feb 2026 14:54:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DeviceStorage.c | 17 +++++++++++++++++ DeviceStorage.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/DeviceStorage.c b/DeviceStorage.c index d5c000c..23b350d 100644 --- a/DeviceStorage.c +++ b/DeviceStorage.c @@ -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); +} \ No newline at end of file diff --git a/DeviceStorage.h b/DeviceStorage.h index 17c0c36..8df8a1a 100644 --- a/DeviceStorage.h +++ b/DeviceStorage.h @@ -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