Make task priority configurable

Add config option 'CONFIG_ASYNC_TCP_TASK_PRIORITY', which defines what
the tasks' priority is (defaults to 3).

Based on https://github.com/me-no-dev/AsyncTCP/pull/98
This commit is contained in:
Alex Villacís Lasso
2021-10-28 17:26:33 -05:00
parent 0714013c68
commit f22b097b2e
2 changed files with 4 additions and 1 deletions

View File

@@ -65,7 +65,7 @@ static bool _start_asyncsock_task(void)
"asyncTcpSock",
CONFIG_ASYNC_TCP_STACK,
NULL,
3, // <-- TODO: make priority a compile-time parameter
CONFIG_ASYNC_TCP_TASK_PRIORITY,
&_asyncsock_service_task_handle,
CONFIG_ASYNC_TCP_RUNNING_CORE);
if (!_asyncsock_service_task_handle) return false;

View File

@@ -47,6 +47,9 @@ extern "C" {
#ifndef CONFIG_ASYNC_TCP_STACK
#define CONFIG_ASYNC_TCP_STACK 16384 // 8192 * 2
#endif
#ifndef CONFIG_ASYNC_TCP_TASK_PRIORITY
#define CONFIG_ASYNC_TCP_TASK_PRIORITY 3
#endif
class AsyncClient;