From b564e8eb3851d976f5e690aaaa13db7c653c7455 Mon Sep 17 00:00:00 2001 From: Nikolay Minaylov Date: Thu, 11 Nov 2021 19:17:50 +0300 Subject: [FL-2010] furi-hal-vcp rework (#812) * [FL-2010] furi-hal-vcp rework * Fix connect state change on vcp enable * New thread naming scheme and stack size adjustment. * Applications: rename worker threads to match new naming scheme. Co-authored-by: Aleksandr Kutuzov --- applications/applications.c | 26 +++++++++++----------- applications/gpio/usb_uart_bridge.c | 13 ++++++----- applications/nfc/nfc_worker.c | 2 +- .../helpers/subghz_frequency_analyzer_worker.c | 2 +- 4 files changed, 22 insertions(+), 21 deletions(-) (limited to 'applications') diff --git a/applications/applications.c b/applications/applications.c index 9b269461..7cc105bb 100644 --- a/applications/applications.c +++ b/applications/applications.c @@ -65,55 +65,55 @@ extern int32_t power_settings_app(void* p); const FlipperApplication FLIPPER_SERVICES[] = { /* Services */ #ifdef SRV_RPC - {.app = rpc_srv, .name = "RPC", .stack_size = 1024 * 4, .icon = NULL}, + {.app = rpc_srv, .name = "RpcSrv", .stack_size = 1024 * 4, .icon = NULL}, #endif #ifdef SRV_BT - {.app = bt_srv, .name = "BT", .stack_size = 1024, .icon = NULL}, + {.app = bt_srv, .name = "BtSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_CLI - {.app = cli_srv, .name = "Cli", .stack_size = 4096, .icon = NULL}, + {.app = cli_srv, .name = "CliSrv", .stack_size = 4096, .icon = NULL}, #endif #ifdef SRV_DIALOGS - {.app = dialogs_srv, .name = "Dialogs", .stack_size = 1024, .icon = NULL}, + {.app = dialogs_srv, .name = "DialogsSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_DOLPHIN - {.app = dolphin_srv, .name = "Dolphin", .stack_size = 1024, .icon = NULL}, + {.app = dolphin_srv, .name = "DolphinSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_DESKTOP - {.app = desktop_srv, .name = "Desktop", .stack_size = 1024, .icon = NULL}, + {.app = desktop_srv, .name = "DesktopSrv", .stack_size = 2048, .icon = NULL}, #endif #ifdef SRV_GUI - {.app = gui_srv, .name = "Gui", .stack_size = 8192, .icon = NULL}, + {.app = gui_srv, .name = "GuiSrv", .stack_size = 2048, .icon = NULL}, #endif #ifdef SRV_INPUT - {.app = input_srv, .name = "Input", .stack_size = 1024, .icon = NULL}, + {.app = input_srv, .name = "InputSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_LOADER - {.app = loader_srv, .name = "Loader", .stack_size = 1024, .icon = NULL}, + {.app = loader_srv, .name = "LoaderSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_NOTIFICATION - {.app = notification_srv, .name = "Notification", .stack_size = 1024, .icon = NULL}, + {.app = notification_srv, .name = "NotificationSrv", .stack_size = 1536, .icon = NULL}, #endif #ifdef SRV_POWER - {.app = power_srv, .name = "Power", .stack_size = 1024, .icon = NULL}, + {.app = power_srv, .name = "PowerSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_POWER_OBSERVER - {.app = power_observer_srv, .name = "PowerObserver", .stack_size = 1024, .icon = NULL}, + {.app = power_observer_srv, .name = "PowerAuditSrv", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_STORAGE - {.app = storage_srv, .name = "Storage", .stack_size = 4096, .icon = NULL}, + {.app = storage_srv, .name = "StorageSrv", .stack_size = 3072, .icon = NULL}, #endif }; diff --git a/applications/gpio/usb_uart_bridge.c b/applications/gpio/usb_uart_bridge.c index ff787ea7..9b43f643 100644 --- a/applications/gpio/usb_uart_bridge.c +++ b/applications/gpio/usb_uart_bridge.c @@ -8,11 +8,12 @@ #define USB_UART_RX_BUF_SIZE (USB_CDC_PKT_LEN * 5) typedef enum { - WorkerEvtStop = (1 << 0), - WorkerEvtRxDone = (1 << 1), + WorkerEvtReserved = (1 << 0), // Reserved for StreamBuffer internal event + WorkerEvtStop = (1 << 1), + WorkerEvtRxDone = (1 << 2), - WorkerEvtTxStop = (1 << 2), - WorkerEvtCdcRx = (1 << 3), + WorkerEvtTxStop = (1 << 3), + WorkerEvtCdcRx = (1 << 4), } WorkerEvtFlags; #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone) @@ -75,7 +76,7 @@ static int32_t usb_uart_worker(void* context) { usb_uart->usb_mutex = osMutexNew(NULL); usb_uart->tx_thread = furi_thread_alloc(); - furi_thread_set_name(usb_uart->tx_thread, "usb_uart_tx"); + furi_thread_set_name(usb_uart->tx_thread, "UsbUartTxWorker"); furi_thread_set_stack_size(usb_uart->tx_thread, 512); furi_thread_set_context(usb_uart->tx_thread, NULL); furi_thread_set_callback(usb_uart->tx_thread, usb_uart_tx_thread); @@ -191,7 +192,7 @@ void usb_uart_enable(UsbUartConfig* cfg) { usb_uart = furi_alloc(sizeof(UsbUartParams)); usb_uart->thread = furi_thread_alloc(); - furi_thread_set_name(usb_uart->thread, "usb_uart"); + furi_thread_set_name(usb_uart->thread, "UsbUartWorker"); furi_thread_set_stack_size(usb_uart->thread, 1024); furi_thread_set_context(usb_uart->thread, cfg); furi_thread_set_callback(usb_uart->thread, usb_uart_worker); diff --git a/applications/nfc/nfc_worker.c b/applications/nfc/nfc_worker.c index c5702362..cbd7fe35 100755 --- a/applications/nfc/nfc_worker.c +++ b/applications/nfc/nfc_worker.c @@ -10,7 +10,7 @@ NfcWorker* nfc_worker_alloc() { NfcWorker* nfc_worker = furi_alloc(sizeof(NfcWorker)); // Worker thread attributes - nfc_worker->thread_attr.name = "nfc_worker"; + nfc_worker->thread_attr.name = "NfcWorker"; nfc_worker->thread_attr.stack_size = 8192; nfc_worker->callback = NULL; nfc_worker->context = NULL; diff --git a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c index 5c7199b6..ddf557a6 100644 --- a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c +++ b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c @@ -145,7 +145,7 @@ SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc() { SubGhzFrequencyAnalyzerWorker* instance = furi_alloc(sizeof(SubGhzFrequencyAnalyzerWorker)); instance->thread = furi_thread_alloc(); - furi_thread_set_name(instance->thread, "subghz_frequency_analyzer_worker"); + furi_thread_set_name(instance->thread, "SubghzFAWorker"); furi_thread_set_stack_size(instance->thread, 2048); furi_thread_set_context(instance->thread, instance); furi_thread_set_callback(instance->thread, subghz_frequency_analyzer_worker_thread); -- cgit v1.2.3