-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Update WiFiGeneric.cpp #7044
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
Merged
Merged
Update WiFiGeneric.cpp #7044
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -664,15 +664,6 @@ bool wifiLowLevelInit(bool persistent){ | |
|
||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); | ||
|
||
if(!WiFiGenericClass::useStaticBuffers()) { | ||
cfg.static_tx_buf_num = 0; | ||
cfg.dynamic_tx_buf_num = 32; | ||
cfg.tx_buf_type = 1; | ||
cfg.cache_tx_buf_num = 1; // can't be zero! | ||
cfg.static_rx_buf_num = 4; | ||
cfg.dynamic_rx_buf_num = 32; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reject this PR and changes.... as explained in |
||
esp_err_t err = esp_wifi_init(&cfg); | ||
if(err){ | ||
log_e("esp_wifi_init %d", err); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was added to reduce the memory footprint of the WiFi driver as it increased considerably from IDF v3 to IDF v4.
Refer to #5791 for this. @SuGlider fyi...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... Default now is WiFi Dynamic Allocation in order to reduce HEAP consumption.
If the user wants to go with Static Allocation, the application shall use
WiFiGenericClass::useStaticBuffers(true);
before setting the WiFi Mode withWiFiGenericClass::mode()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuGlider Although the customers can call
WiFiGenericClass::useStaticBuffers(true)
to solve the problem, but I think we also need to change the valuecfg.cache_tx_buf_num = 1
to at least4
, this will ensure the customers can send several packets at the same time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, Agree. Please commit this change. This will cost 5K RAM in the heap. It is worth it.