Skip to content

Commit 04cee33

Browse files
authored
Merge pull request #20 from espressif/mem-optimized
Mem optimized
2 parents 1180c92 + f459b10 commit 04cee33

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

libraries/WiFi/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=WiFi
2-
version=2.0.0
2+
version=2.0.1
33
author=Hristo Gochkov
44
maintainer=Hristo Gochkov <[email protected]>
55
sentence=Enables network connection (local and Internet) using the ESP32 built-in WiFi.

libraries/WiFi/src/WiFiGeneric.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,18 @@ bool wifiLowLevelInit(bool persistent){
557557
}
558558

559559
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
560+
561+
#if 1
562+
// TWEAK to force Dynamic Buffer instead of Static ones
563+
// This uses less heap space in Arduino and makes it similar to 1.0.6 configuration
564+
cfg.static_tx_buf_num = 0;
565+
cfg.dynamic_tx_buf_num = 32;
566+
cfg.tx_buf_type = 1;
567+
cfg.cache_tx_buf_num = 1; // it can't be zero for WPA/WPA2
568+
cfg.static_rx_buf_num = 4;
569+
cfg.dynamic_rx_buf_num = 32;
570+
#endif
571+
560572
esp_err_t err = esp_wifi_init(&cfg);
561573
if(err){
562574
log_e("esp_wifi_init %d", err);

0 commit comments

Comments
 (0)