From c8cd7afebe15c4cfd532343908a60a05e33c2579 Mon Sep 17 00:00:00 2001 From: cfif Date: Fri, 24 Oct 2025 12:29:49 +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 --- StorageOnFlash.c | 17 +++++++++++++++++ StorageOnFlash.h | 29 +++++++++++++++++++++++++++++ modular.json | 10 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 StorageOnFlash.c create mode 100644 StorageOnFlash.h create mode 100644 modular.json diff --git a/StorageOnFlash.c b/StorageOnFlash.c new file mode 100644 index 0000000..eba0e54 --- /dev/null +++ b/StorageOnFlash.c @@ -0,0 +1,17 @@ +// +// Created by CFIF on 05.04.24. +// +#include "StorageOnFlash.h" + +tStorageOnFlash NVM_STORAGE; + +void StorageOnFlash_Init() { + tStorageOnFlash *env = &NVM_STORAGE; + + vStorageOnFlashFlagchip_Init(&env->nf_storage_calib, nf_storage_calib_mainFlashPageAddress,nf_storage_calib_recoveryFlashPageAddress); + env->interface_calib = xStorageOnFlashFlagchip_GetInterface(&env->nf_storage_calib); + + vStorageOnFlashFlagchip_Init(&env->nf_storage_param, nf_storage_param_mainFlashPageAddress,nf_storage_param_recoveryFlashPageAddress); + env->interface_param = xStorageOnFlashFlagchip_GetInterface(&env->nf_storage_param); + +} \ No newline at end of file diff --git a/StorageOnFlash.h b/StorageOnFlash.h new file mode 100644 index 0000000..0b0b94b --- /dev/null +++ b/StorageOnFlash.h @@ -0,0 +1,29 @@ +// +// Created by CFIF on 05.04.24. +// + +#ifndef HVAC_STORAGEONFLASH_H +#define HVAC_STORAGEONFLASH_H + +#include "StorageOnFlashFlagchip.h" + +#define nf_storage_calib_mainFlashPageAddress 0x04000000 +#define nf_storage_calib_recoveryFlashPageAddress 0x04000000 + +#define nf_storage_param_mainFlashPageAddress 0x04000000 +#define nf_storage_param_recoveryFlashPageAddress 0x04000000 + +typedef struct { + tStorageOnFlashFlagchip nf_storage_calib; + tStorageInterface interface_calib; + + tStorageOnFlashFlagchip nf_storage_param; + tStorageInterface interface_param; +} tStorageOnFlash; + + +extern tStorageOnFlash NVM_STORAGE; + +void StorageOnFlash_Init(); + +#endif //HVAC_STORAGEONFLASH_H diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..0dd1901 --- /dev/null +++ b/modular.json @@ -0,0 +1,10 @@ +{ + "cmake": { + "inc_dirs": [ + "./" + ], + "srcs": [ + "./**.c" + ] + } +} \ No newline at end of file