This commit is contained in:
cfif 2025-06-02 15:22:57 +03:00
commit 6673f03640
3 changed files with 52 additions and 0 deletions

24
DeviceStorage.c Normal file
View File

@ -0,0 +1,24 @@
//
// Created by cfif on 07.10.22.
//
#include "DeviceStorage.h"
#include "StorageOnFlashArtery.h"
#include "InternalFlashPage.h"
bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageInterface) {
tStorageOnFlashArtery *store = (tStorageOnFlashArtery *) storageInterface->env;
sInternalFlashPage_Read(store->mainFlashPageAddress, 0x0, (uint8_t *) &env->nvm, sizeof(env->nvm));
/*
if ((env->nvm.SettingsServerConnection.EGTS_SERVER_ADDRESS.length > 32) ||
(env->nvm.SettingsServerConnection.EGTS_ALT_SERVER_ADDRESS.length > 32) ||
(env->nvm.SettingsServerConnection.EGTS_GPRS_APN.length > 32)) {
DeviceDataNonVolatile_InitDefaults(&env->nvm);
return false;
}
*/
return true;
}

18
DeviceStorage.h Normal file
View File

@ -0,0 +1,18 @@
//
// Created by zemon on 20.02.24.
//
#ifndef HEAVY_TERMINAL_DEVICESTORAGE_H
#define HEAVY_TERMINAL_DEVICESTORAGE_H
#include "DataNonVolatile.h"
#include "StorageIO.h"
#include "stdbool.h"
typedef struct {
tDeviceDataNonVolatile nvm;
} tDeviceStorage;
bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageInterface);
#endif //HEAVY_TERMINAL_DEVICESTORAGE_H

10
modular.json Normal file
View File

@ -0,0 +1,10 @@
{
"cmake": {
"inc_dirs": [
"./"
],
"srcs": [
"./**.c"
]
}
}