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:
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,11.5,,
|
||||
Version,+,11.6,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -2480,6 +2480,7 @@ Function,+,stream_read_line,_Bool,"Stream*, FuriString*"
|
||||
Function,+,stream_rewind,_Bool,Stream*
|
||||
Function,+,stream_save_to_file,size_t,"Stream*, Storage*, const char*, FS_OpenMode"
|
||||
Function,+,stream_seek,_Bool,"Stream*, int32_t, StreamOffset"
|
||||
Function,+,stream_seek_to_char,_Bool,"Stream*, char, StreamDirection"
|
||||
Function,+,stream_size,size_t,Stream*
|
||||
Function,+,stream_split,_Bool,"Stream*, Stream*, Stream*"
|
||||
Function,+,stream_tell,size_t,Stream*
|
||||
|
|
@@ -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