[FL-2274] Inventing streams and moving FFF to them (#981)

* Streams: string stream
* String stream: updated insert/delete api
* Streams: generic stream interface and string stream implementation
* Streams: helpers for insert and delete_and_insert
* FFF: now compatible with streams
* MinUnit: introduced tests with arguments
* FFF: stream access violation
* Streams: copy data between streams
* Streams: file stream
* FFF: documentation
* FFStream: documentation
* FFF: alloc as file
* MinUnit: support for nested tests
* Streams: changed delete_and_insert, now it returns success flag. Added ability dump stream inner parameters and data to cout.
* FFF: simplified file open function
* Streams: unit tests
* FFF: tests
* Streams: declare cache_size constant as define, to allow variable modified arrays
* FFF: lib moved to a separate folder
* iButton: new FFF
* RFID: new FFF
* Animations: new FFF
* IR: new FFF
* NFC: new FFF
* Flipper file format: delete lib
* U2F: new FFF
* Subghz: new FFF and streams
* Streams: read line
* Streams: split
* FuriCore: implement memset with extra asserts
* FuriCore: implement extra heap asserts without inventing memset
* Scene manager: protected access to the scene id stack with a size check
* NFC worker: dirty fix for issue where hal_nfc was busy on app start
* Furi: update allocator to erase memory on allocation. Replace furi_alloc with malloc.
* FuriCore: cleanup memmgr code.
* Furi HAL: furi_hal_init is split into critical and non-critical parts. The critical part is currently clock and console.
* Memmgr: added ability to track allocations and deallocations through console.
* FFStream: some speedup
* Streams, FF: minor fixes
* Tests: restore
* File stream: a slightly more thread-safe version of file_stream_delete_and_insert

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
SG
2022-02-19 05:53:46 +10:00
committed by GitHub
parent 242241987e
commit 274c12fc56
257 changed files with 4480 additions and 2657 deletions

View File

@@ -17,7 +17,7 @@ static const uint16_t service_uuid = BATTERY_SERVICE_UUID;
static const uint16_t char_battery_level_uuid = BATTERY_LEVEL_CHAR_UUID;
void battery_svc_start() {
battery_svc = furi_alloc(sizeof(BatterySvc));
battery_svc = malloc(sizeof(BatterySvc));
tBleStatus status;
// Add Battery service

View File

@@ -35,7 +35,7 @@ static void ble_app_hci_status_not_handler(HCI_TL_CmdStatus_t status);
bool ble_app_init() {
SHCI_CmdStatus_t status;
ble_app = furi_alloc(sizeof(BleApp));
ble_app = malloc(sizeof(BleApp));
// Allocate semafore and mutex for ble command buffer access
ble_app->hci_mtx = osMutexNew(NULL);
ble_app->hci_sem = osSemaphoreNew(1, 0, NULL);

View File

@@ -64,7 +64,7 @@ void ble_glue_set_key_storage_changed_callback(
}
void ble_glue_init() {
ble_glue = furi_alloc(sizeof(BleGlue));
ble_glue = malloc(sizeof(BleGlue));
ble_glue->status = BleGlueStatusStartup;
// Configure the system Power Mode

View File

@@ -23,7 +23,7 @@ static const char dev_info_software_rev_num[] = GIT_COMMIT " " GIT_BRANCH " " GI
" " BUILD_DATE;
void dev_info_svc_start() {
dev_info_svc = furi_alloc(sizeof(DevInfoSvc));
dev_info_svc = malloc(sizeof(DevInfoSvc));
tBleStatus status;
// Add Device Information Service

View File

@@ -463,7 +463,7 @@ bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context) {
return false;
}
gap = furi_alloc(sizeof(Gap));
gap = malloc(sizeof(Gap));
gap->config = config;
srand(DWT->CYCCNT);
// Create advertising timer
@@ -516,7 +516,7 @@ GapState gap_get_state() {
void gap_start_scan(GapScanCallback callback, void* context) {
furi_assert(callback);
gap_scan = furi_alloc(sizeof(GapScan));
gap_scan = malloc(sizeof(GapScan));
gap_scan->callback = callback;
gap_scan->context = context;
// Scan interval 250 ms

View File

@@ -38,7 +38,7 @@ static SVCCTL_EvtAckStatus_t hid_svc_event_handler(void* event) {
void hid_svc_start() {
tBleStatus status;
hid_svc = furi_alloc(sizeof(HIDSvc));
hid_svc = malloc(sizeof(HIDSvc));
Service_UUID_t svc_uuid = {};
Char_Desc_Uuid_t desc_uuid = {};
Char_UUID_t char_uuid = {};

View File

@@ -82,7 +82,7 @@ static SVCCTL_EvtAckStatus_t serial_svc_event_handler(void* event) {
void serial_svc_start() {
tBleStatus status;
serial_svc = furi_alloc(sizeof(SerialSvc));
serial_svc = malloc(sizeof(SerialSvc));
// Register event handler
SVCCTL_RegisterSvcHandler(serial_svc_event_handler);