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:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user