From e71ca215c388d0841097efbd2c2b7ae47f3b8f99 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Fri, 8 Mar 2024 10:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUSB=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usb/usb_io.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/usb/usb_io.cpp b/usb/usb_io.cpp index 2319eac..f1391cb 100644 --- a/usb/usb_io.cpp +++ b/usb/usb_io.cpp @@ -42,15 +42,15 @@ async_usb_gadget::async_usb_gadget(std::function return; } - auto ep0 = [this](void) -> void + auto ep0 = [this](void*) -> void { thread_read_ep0(); }; - auto task = [this](void) -> void + auto task = [this](void*) -> void { thread_pump_task(); }; - auto bulkw = [this](void) -> void + auto bulkw = [this](void*) -> void { while(run_) { @@ -69,7 +69,7 @@ async_usb_gadget::async_usb_gadget(std::function } } }; - auto bulkr = [this](void) -> void + auto bulkr = [this](void*) -> void { while(run_) { @@ -89,7 +89,7 @@ async_usb_gadget::async_usb_gadget(std::function } }; - auto excep = [&](const char* thread_name) -> void + auto excep = [&](const char* thread_name, void* param) -> void { threads_.stop(thread_name); // threads_.start(task, "thread_pump_task"); @@ -112,10 +112,10 @@ async_usb_gadget::async_usb_gadget(std::function utils::to_log(LOG_LEVEL_DEBUG, "Prepare %u(%u * %u) for IO.\n", io_buf_.size() * unit_out_, io_buf_.size(), unit_in_); #endif - threads_.start(task, SIZE_MB(4), "thread_pump_task", (void*)&async_usb_gadget::thread_pump_task); - threads_.start(bulkw, SIZE_MB(2), "thread_write_bulk", (void*)&async_usb_gadget::thread_write_bulk); - threads_.start(bulkr, SIZE_MB(2), "thread_read_bulk", (void*)&async_usb_gadget::thread_read_bulk); - threads_.start(ep0, SIZE_MB(1), "thread_read_ep0", (void*)&async_usb_gadget::thread_read_ep0); + threads_.start(task, nullptr, SIZE_MB(4), "thread_pump_task", (void*)&async_usb_gadget::thread_pump_task); + threads_.start(bulkw, nullptr, SIZE_MB(2), "thread_write_bulk", (void*)&async_usb_gadget::thread_write_bulk); + threads_.start(bulkr, nullptr, SIZE_MB(2), "thread_read_bulk", (void*)&async_usb_gadget::thread_read_bulk); + threads_.start(ep0, nullptr, SIZE_MB(1), "thread_read_ep0", (void*)&async_usb_gadget::thread_read_ep0); } async_usb_gadget::~async_usb_gadget()