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

@@ -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*
1 entry status name type params
2 Version + 11.5 11.6
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
2480 Function + stream_rewind _Bool Stream*
2481 Function + stream_save_to_file size_t Stream*, Storage*, const char*, FS_OpenMode
2482 Function + stream_seek _Bool Stream*, int32_t, StreamOffset
2483 Function + stream_seek_to_char _Bool Stream*, char, StreamDirection
2484 Function + stream_size size_t Stream*
2485 Function + stream_split _Bool Stream*, Stream*, Stream*
2486 Function + stream_tell size_t Stream*

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");
}
}