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);