Various improvements: Toolbox, Updater and Unit Tests. (#2250)

* Toolbox: add seek to character stream method. UpdateUtils: reverse manifest iterator. UnitTests: more unit tests.
* Target: bump API version. Updater: delete empty folders from manifest before resource deployment.
* UnitTests: use manifest from unit_tests folder instead of global one
* Make PVS happy
* sector cache: allocate always
* Better PVS config for manifest.c
* PVS: Move exception outside of condition
* PVS: remove confusing condition

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
あく
2023-01-06 15:31:17 +09:00
committed by GitHub
parent b8dd75884c
commit 41c43f4805
11 changed files with 398 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
#define SECTOR_SIZE 512
#define N_SECTORS 8
#define TAG "SDCache"
typedef struct {
uint32_t itr;
@@ -19,14 +20,15 @@ static SectorCache* cache = NULL;
void sector_cache_init() {
if(cache == NULL) {
cache = furi_hal_memory_alloc(sizeof(SectorCache));
// TODO: tuneup allocation order, to place cache in mem pool (MEM2)
cache = memmgr_alloc_from_pool(sizeof(SectorCache));
}
if(cache != NULL) {
FURI_LOG_I("SectorCache", "Initializing sector cache");
FURI_LOG_I(TAG, "Init");
memset(cache, 0, sizeof(SectorCache));
} else {
FURI_LOG_E("SectorCache", "Cannot enable sector cache");
FURI_LOG_E(TAG, "Init failed");
}
}