From e7cca765e9c3cdec9a762cf7c912d2fc9aeb119c Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 19 Jan 2026 13:55:03 +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 | 18 +++++++++++++----- DeviceStorage.h | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/DeviceStorage.c b/DeviceStorage.c index 49fb669..d5c000c 100644 --- a/DeviceStorage.c +++ b/DeviceStorage.c @@ -101,7 +101,7 @@ void DeviceStorage_InitCommon(tDeviceStorage *env, tStorageInterface *storageCal SECT_SRAM_NVM uint8_t dataReservedParamStore[nf_storage_param_size]; -bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageCalibInterface, +bool DeviceStorage_Init(tDeviceStorage *env, bool loadParamOnly, tStorageInterface *storageCalibInterface, tStorageInterface *storageParamInterface, tLoggerInterface *logger) { @@ -115,11 +115,19 @@ bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageCalibInte DeviceStorage_InitCommon(env, storageCalibInterface, nf_storage_calib_size, storageParamInterface, nf_storage_param_size); - bool resultParam = DeviceStorage_LoadParam(env); - bool resultCalib = DeviceStorage_LoadCalib(env); + if (loadParamOnly) { + bool resultParam = DeviceStorage_LoadParam(env); - if ((resultParam) && (resultCalib)) { - return true; + if (resultParam) { + return true; + } + } else { + bool resultParam = DeviceStorage_LoadParam(env); + bool resultCalib = DeviceStorage_LoadCalib(env); + + if ((resultParam) && (resultCalib)) { + return true; + } } return false; diff --git a/DeviceStorage.h b/DeviceStorage.h index 6169dcd..17c0c36 100644 --- a/DeviceStorage.h +++ b/DeviceStorage.h @@ -23,7 +23,7 @@ typedef struct { uint8_t trackableVarsTab; } tDeviceStorage; -bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageCalibInterface, +bool DeviceStorage_Init(tDeviceStorage *env, bool loadParamOnly, tStorageInterface *storageCalibInterface, tStorageInterface *storageParamInterface, tLoggerInterface *logger);