Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make event queue size adjustable via Kconfig #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ config ASYNC_TCP_USE_WDT
help
Enable WDT for the AsyncTCP task, so it will trigger if a handler is locking the thread.

config ASYNC_TCP_EVENT_QUEUE_SIZE
int "Event queue size"
default 32
help
Set the event queue size. Increasing this value may fix WDT triggers with larger transfers.

endmenu
2 changes: 1 addition & 1 deletion src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static uint32_t _closed_index = []() {

static inline bool _init_async_event_queue(){
if(!_async_queue){
_async_queue = xQueueCreate(32, sizeof(lwip_event_packet_t *));
_async_queue = xQueueCreate(CONFIG_ASYNC_TCP_EVENT_QUEUE_SIZE, sizeof(lwip_event_packet_t *));
if(!_async_queue){
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions src/AsyncTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ extern "C" {
#define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event
#endif

#ifndef CONFIG_ASYNC_TCP_EVENT_QUEUE_SIZE
#define CONFIG_ASYNC_TCP_EVENT_QUEUE_SIZE 32
#endif

class AsyncClient;

#define ASYNC_MAX_ACK_TIME 5000
Expand Down