[FL-2256] USB Service (#998)

* usb service, removed power observer
* fix usb restart after disable
* remove usb service from apps
* Applcations: remove dead extern
* New thread naming scheme for drivers
* New thread symbol naming scheme for drivers

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-02-16 20:52:34 +03:00
committed by GitHub
parent a37f1d0f6f
commit 242241987e
17 changed files with 356 additions and 286 deletions

View File

@@ -1,5 +1,5 @@
#include <furi_hal_usb_cdc_i.h>
#include <furi_hal_console.h>
#include <furi_hal.h>
#include <furi.h>
#include <stream_buffer.h>
@@ -65,7 +65,7 @@ void furi_hal_vcp_init() {
vcp->rx_stream = xStreamBufferCreate(VCP_RX_BUF_SIZE, 1);
vcp->thread = furi_thread_alloc();
furi_thread_set_name(vcp->thread, "VcpWorker");
furi_thread_set_name(vcp->thread, "VcpDriver");
furi_thread_set_stack_size(vcp->thread, 1024);
furi_thread_set_callback(vcp->thread, vcp_worker);
furi_thread_start(vcp->thread);
@@ -79,6 +79,7 @@ static int32_t vcp_worker(void* context) {
size_t missed_rx = 0;
uint8_t last_tx_pkt_len = 0;
furi_hal_usb_set_config(&usb_cdc_single);
furi_hal_cdc_set_callbacks(VCP_IF_NUM, &cdc_cb, NULL);
while(1) {