diff --git a/DeviceStorage.c b/DeviceStorage.c index 9caeaff..0b817a3 100644 --- a/DeviceStorage.c +++ b/DeviceStorage.c @@ -9,6 +9,7 @@ #include "StorageOnFlashFlagchip.h" #include "SystemDelayInterface.h" #include "HVAC_preDefine.h" +#include "StorageOnFlash.h" #define LOGGER env->logger #define LOG_SIGN "Хран." @@ -91,7 +92,7 @@ void DeviceStorage_InitCommon(tDeviceStorage *env, tStorageInterface *storageCal } -SECT_SRAM_NVM uint8_t dataReservedParamStore[2 * FLASH_PAGE_SIZE]; +SECT_SRAM_NVM uint8_t dataReservedParamStore[nf_storage_param_size]; extern uint32_t __caldata_start[]; bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageCalibInterface, @@ -103,8 +104,8 @@ bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageCalibInte env->dataParam = (tDeviceDataNonVolatile *) dataReservedParamStore; env->dataCalib = (void *) __caldata_start; - DeviceStorage_InitCommon(env, storageParamInterface, sizeof(dataReservedParamStore), - storageCalibInterface, 7 * FLASH_PAGE_SIZE); + DeviceStorage_InitCommon(env, storageParamInterface, nf_storage_param_size, + storageCalibInterface, nf_storage_calib_size); bool resultParam = DeviceStorage_LoadParam(env); bool resultCalib = DeviceStorage_LoadCalib(env);