Skip to content

Commit

Permalink
feat(mdns): Allow allocate memory with configured caps
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Feb 13, 2025
1 parent f1a72ec commit 2c63154
Show file tree
Hide file tree
Showing 10 changed files with 559 additions and 372 deletions.
6 changes: 4 additions & 2 deletions components/mdns/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ else()
set(MDNS_CONSOLE "")
endif()

set(MDNS_MEMORY "mdns_mem_caps.c")

idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
set(dependencies esp_netif_linux esp_event)
set(private_dependencies esp_timer console esp_system)
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
set(srcs "mdns.c" ${MDNS_MEMORY} ${MDNS_NETWORKING} ${MDNS_CONSOLE})
else()
set(dependencies lwip console esp_netif)
set(private_dependencies esp_timer esp_wifi)
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
set(srcs "mdns.c" ${MDNS_MEMORY} ${MDNS_NETWORKING} ${MDNS_CONSOLE})
endif()

idf_component_register(
Expand Down
12 changes: 12 additions & 0 deletions components/mdns/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ menu "mDNS"
bool "mDNS task creates on the internal RAM"
endchoice

choice MDNS_MEMORY_ALLOC_FROM
prompt "Select mDNS memory allocation type"
default MDNS_MEMORY_ALLOC_INTERNAL

config MDNS_MEMORY_ALLOC_SPIRAM
bool "Allocate mDNS memory from SPIRAM"
depends on (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC)

config MDNS_MEMORY_ALLOC_INTERNAL
bool "Allocate mDNS memory from internal RAM"
endchoice

config MDNS_SERVICE_ADD_TIMEOUT_MS
int "mDNS adding service timeout (ms)"
range 10 30000
Expand Down
Loading

0 comments on commit 2c63154

Please sign in to comment.